<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:pages')
                    <a href="{{ route('daylight.content.pages.edit', ['page' => $row, 'locale' => request()->get('locale', $locale)]) }}">{{ $row->translations->first()->name }}</a>
                @else
                    {{ $row->translations->first()->name }}
                @endif
            </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>
                <span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full {{ $row->status->adminColor() }}">
                    {{ $row->status->label() }}
                </span>
            </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.pages.edit', ['page' => $row, 'locale' => request()->get('locale', $locale)])"
                    :can-duplicate="true"
                    :can-delete="true"
                    :row-id="$row->id"
                />
            </x-slot:actions>
        </x-daylight::tables.row>
    @endforeach
</x-daylight::tables.table>
