@props([ 'tabs', 'contents' => [], 'active' => null, 'justifyAlign' => 'start', 'isVertical' => false, ]) @if($tabs) @php // Если содержимое не передано, создаем его из слотов if ($contents === []) { $tabs = collect($tabs) ->mapWithKeys(fn($value, $name) => [ Str::camel($name) => $value ]) ->all(); $contents = collect($__laravel_slots ?? []) ->mapWithKeys(fn($contentSlot, $name) => [ Str::camel($name) => $contentSlot ]) ->filter(fn($contentSlot, $name) => array_key_exists($name, $tabs)) ->all(); } @endphp