<x-daylight::tables.table>
    <x-slot:columns>
        <x-daylight::tables.sortable-column field="name">
            {{ __('daylight::general.name') }}
        </x-daylight::tables.sortable-column>

        <th class="p-3 text-left text-sm font-semibold text-gray-900">
            {{ __('daylight::general.locales') }}
        </th>

        <th class="p-3 text-left text-sm font-semibold text-gray-900">
            {{ __('daylight::general.status') }}
        </th>

        <x-daylight::tables.sortable-column field="created_at">
            {{ __('daylight::general.created_at') }}
        </x-daylight::tables.sortable-column>
    </x-slot:columns>

    @foreach ($this->rows as $row)
        <x-daylight::tables.row wire:key="{{ $row->id }}" :$row>
            <x-daylight::tables.column>
                @can('update:menus')
                    <a href="{{ route('daylight.content.menus.edit', ['menu' => $row, 'locale' => request()->get('locale', $locale)]) }}">{{ $row->name }}</a>
                @else
                    {{ $row->name }}
                @endcan
            </x-daylight::tables.column>

            <x-daylight::tables.column>
                <div class="flex -space-x-1 overflow-hidden">
                    @foreach($row->translations as $translation)
                        <img src="{{ daylightAsset('resources/assets/images/flags/'.strtolower($translation->locale).'.svg') }}" alt="{{ $row->name }}" class="inline-block h-5 w-5 rounded-full ring-2 ring-white mr-2">
                    @endforeach
                </div>
            </x-daylight::tables.column>

            <x-daylight::tables.column>
                <x-daylight::badge :class="$row->status->adminColor()">
                    {{ $row->status->label() }}
                </x-daylight::badge>
            </x-daylight::tables.column>

            <x-daylight::tables.column>{{ $row->created_at->isoFormat('LLL') }}</x-daylight::tables.column>

            <x-slot:actions>
                <x-daylight::tables.row-actions
                    :edit-url="route('daylight.content.menus.edit', ['menu' => $row, 'locale' => request()->get('locale', $locale)])"
                    :can-duplicate="false"
                    :can-delete="true"
                    :row-id="$row->id"
                />
            </x-slot:actions>
        </x-daylight::tables.row>
    @endforeach
</x-daylight::tables.table>
