{{-- Tabs Component - TailAdmin style Usage: Overview content Settings content Logs content --}} @props([ 'tabs' => [], 'active' => null, 'variant' => 'default', ]) @php $variantClasses = [ 'default' => [ 'container' => 'inline-flex items-center gap-1 rounded-lg border border-gray-200 bg-gray-50 p-1 dark:border-gray-800 dark:bg-gray-800/50', 'tab' => 'inline-flex items-center justify-center whitespace-nowrap rounded-md px-4 py-2 text-theme-sm font-medium transition-all duration-150', 'active' => 'bg-white text-gray-800 shadow-theme-xs dark:bg-gray-900 dark:text-white/90', 'inactive' => 'text-gray-500 hover:bg-gray-100 hover:text-gray-700 dark:text-gray-400 dark:hover:bg-gray-800 dark:hover:text-gray-300', ], 'pills' => [ 'container' => 'inline-flex items-center gap-1 rounded-lg border border-gray-200 bg-gray-50 p-1 dark:border-gray-800 dark:bg-gray-800/50', 'tab' => 'inline-flex items-center justify-center whitespace-nowrap rounded-md px-4 py-2 text-theme-sm font-medium transition-all duration-150', 'active' => 'bg-white text-gray-800 shadow-theme-xs dark:bg-gray-900 dark:text-white/90', 'inactive' => 'text-gray-500 hover:bg-gray-100 hover:text-gray-700 dark:text-gray-400 dark:hover:bg-gray-800 dark:hover:text-gray-300', ], 'buttons' => [ 'container' => 'flex gap-2', 'tab' => 'inline-flex items-center justify-center whitespace-nowrap rounded-lg px-4 py-2.5 text-theme-sm font-medium transition-colors duration-150', 'active' => 'bg-brand-500 text-white shadow-theme-xs hover:bg-brand-600', 'inactive' => 'bg-white text-gray-700 shadow-theme-xs ring-1 ring-gray-300 hover:bg-gray-50 dark:bg-gray-800 dark:text-gray-300 dark:ring-gray-700 dark:hover:bg-gray-700', ], ]; $styles = $variantClasses[$variant] ?? $variantClasses['default']; $activeTab = $active ?? ($tabs[0] ?? null); @endphp
{{-- Tab Navigation --}}
@foreach($tabs as $tab) @php $tabName = is_array($tab) ? ($tab['name'] ?? $tab['label'] ?? '') : $tab; $tabLabel = is_array($tab) ? ($tab['label'] ?? $tab['name'] ?? '') : $tab; $tabIcon = is_array($tab) ? ($tab['icon'] ?? null) : null; $tabBadge = is_array($tab) ? ($tab['badge'] ?? null) : null; @endphp @endforeach
{{-- Tab Panels --}}
{{ $slot }}