@props([
    'variant' => 'primary',
    'href' => null,
    'type' => 'button',
    'size' => null,
    'icon' => null,
])

@php
    $classes = array_filter([
        'btn',
        "btn-{$variant}",
        $size ? "btn-{$size}" : null,
    ]);
    $classes = implode(' ', $classes);
    $tag = $href ? 'a' : 'button';
@endphp

<{{ $tag }}
    @if ($href) href="{{ $href }}" @else type="{{ $type }}" @endif
    {{ $attributes->class($classes) }}
>
    @if ($icon)<i class="{{ $icon }} me-1"></i>@endif
    {{ $slot }}
</{{ $tag }}>
