adrema/app/View/Ui/Action.php

30 lines
646 B
PHP
Raw Normal View History

2024-10-17 00:25:58 +02:00
<?php
namespace App\View\Ui;
use App\View\Traits\HasColors;
use Illuminate\View\Component;
class Action extends Component
{
use HasColors;
public function __construct(
public string $icon,
public string $variant = 'primary'
) {
}
public function render()
{
return <<<'HTML'
2024-10-18 21:36:52 +02:00
<a x-tooltip.raw="{{$slot}}" href="#" {{ $attributes }} class="inline-flex
2024-10-17 00:25:58 +02:00
w-6 h-5 flex items-center justify-center rounded {{ $allColors($variant) }}
">
<x-ui::sprite class="w-3 h-3 flex-none" :src="$icon"></x-ui::sprite>
</a>
HTML;
}
}