@php use Illuminate\Support\Arr; use SolutionForest\FilamentTranslateField\Forms\Component\Translate\Tab; $locales = $getLocales() ?? []; $defaultLocale = $locales[0] ?? null; $isContained = $isContained(); $visibleTabClasses = \Illuminate\Support\Arr::toCssClasses([ 'p-6' => $isContained, 'mt-6' => ! $isContained, ]); $invisibleTabClasses = 'invisible h-0 overflow-y-hidden p-0'; $childComponentsWithLocale = collect($getChildComponentContainers()) ->map(fn ($container) => $container->getComponents()); $tabs = collect($childComponentsWithLocale) ->map(fn ($components) => Arr::first($components, fn ($component) => $component instanceof Tab)); $livewireKey = "{$this->getId()}.{$getStatePath()}." . \SolutionForest\FilamentTranslateField\Forms\Component\Translate::class . '.container'; @endphp
merge([ 'id' => $getId(), 'wire:key' => $livewireKey, ], escape: false) ->merge($getExtraAttributes(), escape: false) ->merge($getExtraAlpineAttributes(), escape: false) ->class([ 'fi-fo-translate flex flex-col', 'fi-contained rounded-xl bg-white shadow-sm ring-1 ring-gray-950/5 dark:bg-gray-900 dark:ring-white/10' => $isContained, ]) }} > @foreach ($tabs as $tab) @php $tabId = $tab->getId(); @endphp {{ $tab->getLabel() }} @endforeach @foreach ($tabs as $locale => $tab) {{ $tab }} @endforeach