@props([ 'tabs' => [], 'initial' => null, ]) @php $normalized = collect($tabs) ->map(fn ($tab) => [ 'key' => (string) ($tab['key'] ?? ''), 'label' => (string) ($tab['label'] ?? ''), ]) ->filter(fn ($tab) => $tab['key'] !== '' && $tab['label'] !== '') ->values(); $initial = $initial ?? ($normalized->first()['key'] ?? ''); @endphp @if ($normalized->isNotEmpty())
class(['site-detail-tabs eca-detail-glass']) }} x-data="{ tab: @js($initial) }" data-reveal="section" >
@foreach ($normalized as $tabDef) @endforeach
{{ $slot }}
@endif