2024-10-14 20:25:11 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\View\Form;
|
|
|
|
|
|
|
|
use App\View\Traits\HasFormDimensions;
|
|
|
|
use Illuminate\View\Component;
|
|
|
|
|
|
|
|
class Label extends Component
|
|
|
|
{
|
|
|
|
|
|
|
|
use HasFormDimensions;
|
|
|
|
|
|
|
|
public function __construct(
|
|
|
|
public bool $required = false,
|
|
|
|
) {
|
|
|
|
}
|
|
|
|
|
|
|
|
public function render()
|
|
|
|
{
|
|
|
|
return <<<'HTML'
|
|
|
|
<span class="font-semibold leading-none text-gray-400 group-[.size-default]:text-sm group-[.size-sm]:text-xs">
|
|
|
|
{{ $slot }}
|
|
|
|
@if ($required)
|
2024-10-17 22:24:58 +02:00
|
|
|
<span class="text-red-800"> *</span>
|
2024-10-14 20:25:11 +02:00
|
|
|
@endif
|
|
|
|
</span>
|
|
|
|
HTML;
|
|
|
|
}
|
|
|
|
}
|