@php use Filament\Support\Enums\IconSize; use Filament\Support\Enums\Size; use Filament\Support\View\Components\BadgeComponent; use Filament\Support\View\Components\DropdownComponent\ItemComponent; use Filament\Support\View\Components\DropdownComponent\ItemComponent\IconComponent; use Illuminate\View\ComponentAttributeBag; @endphp @props([ 'badge' => null, 'badgeColor' => 'primary', 'badgeTooltip' => null, 'color' => 'gray', 'disabled' => false, 'href' => null, 'icon' => null, 'iconAlias' => null, 'iconColor' => null, 'iconSize' => null, 'image' => null, 'keyBindings' => null, 'loadingIndicator' => true, 'spaMode' => null, 'tag' => 'button', 'target' => null, 'tooltip' => null, ]) @php if (filled($iconSize) && (! $iconSize instanceof IconSize)) { $iconSize = IconSize::tryFrom($iconSize) ?? $iconSize; } $iconColor ??= $color; $wireTarget = $loadingIndicator ? $attributes->whereStartsWith(['wire:target', 'wire:click'])->filter(fn ($value): bool => filled($value))->first() : null; $hasLoadingIndicator = filled($wireTarget); if ($hasLoadingIndicator) { $loadingIndicatorTarget = html_entity_decode($wireTarget, ENT_QUOTES); } $hasTooltip = filled($tooltip); @endphp {!! ($tag === 'form') ? ('
' : '' !!}