@props([
    'tabs' => [],
    'active' => null,
])

<div {{ $attributes->merge(['class' => 'tabs']) }}>
    @foreach ($tabs as $key => $tab)
        @php
            $isActive = ($active ?? array_key_first($tabs)) === $key;
            $href = $tab['href'] ?? null;
        @endphp
        @if ($href)
            <a href="{{ $href }}" class="tab {{ $isActive ? 'active' : '' }}">{{ $tab['label'] }}</a>
        @else
            <span class="tab {{ $isActive ? 'active' : '' }}">{{ $tab['label'] }}</span>
        @endif
    @endforeach
</div>
