@props([
    'name',
    'label',
    'href' => null,
    'type' => 'button',
    'variant' => 'ghost', // ghost | chip | chip-light
    'gradient' => false,
    'iconClass' => 'h-5 w-5',
])
@php
    $variantClass = match ($variant) {
        'chip' => 'icon-chip',
        'chip-light' => 'icon-chip icon-chip--on-light',
        default => '',
    };
    $classes = trim("icon-btn $variantClass");
@endphp
@if ($href)
    <a
        href="{{ $href }}" aria-label="{{ $label }}"
        {{ $attributes->merge(['class' => $classes]) }}
    >
        <x-icon :name="$name" :gradient="$gradient" :class="$iconClass" />
        {{ $badge ?? '' }}
    </a>
@else
    <button
        type="{{ $type }}" aria-label="{{ $label }}"
        {{ $attributes->merge(['class' => $classes]) }}
    >
        <x-icon :name="$name" :gradient="$gradient" :class="$iconClass" />
        {{ $badge ?? '' }}
    </button>
@endif
