@props([
    'href',
    'method' => 'GET',
    'active' => false,
])

@if($method === 'POST')
    <form method="POST" action="{{ $href }}">
        @csrf
        <button type="submit"
            {{ $attributes->merge(['class' => 'w-full flex items-center gap-3 px-3 py-2.5 rounded-lg text-sm transition-colors ' .
                ($active
                    ? 'bg-indigo-50 text-indigo-700 font-medium'
                    : 'text-gray-500 hover:bg-gray-50 hover:text-gray-700')
            ]) }}
        >
            {{ $slot }}
        </button>
    </form>
@else
    <a href="{{ $href }}" wire:navigate
        {{ $attributes->merge(['class' => 'flex items-center gap-3 px-3 py-2.5 rounded-lg text-sm transition-colors ' .
            ($active
                ? 'bg-indigo-50 text-indigo-700 font-medium'
                : 'text-gray-500 hover:bg-gray-50 hover:text-gray-700')
        ]) }}
    >
        {{ $slot }}
    </a>
@endif
