@props([
'variant' => 'primary',
'size' => 'md',
'type' => 'button',
'href' => null,
'icon' => null,
'loading' => false,
])
@php
$classes = collect([
'bv-btn',
'bv-btn--' . $variant,
'bv-btn--' . $size,
$loading ? 'is-loading' : '',
])->filter()->implode(' ');
$tag = $href ? 'a' : 'button';
@endphp
<{{ $tag }}
@if($href) href="{{ $href }}" @else type="{{ $type }}" @endif
{{ $attributes->merge(['class' => $classes]) }}
@if($loading) disabled aria-busy="true" @endif
>
@if($loading)
@elseif($icon)
@endif
{{ $slot }}
{{ $tag }}>