<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.status') }}
        </th>

        <th class="p-3 text-left text-sm font-semibold text-gray-900">
            {{ __('daylight::forms.submissions') }}
        </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.forms.edit', $row) }}">{{ $row->name }}</a>
                @else
                    {{ $row->name }}
                @endcan
            </x-daylight::tables.column>

            <x-daylight::tables.column>
                @if($row->is_active)
                    <x-daylight::badge class="bg-green-50 text-green-700">
                        {{ __('daylight::forms.is_active') }}
                    </x-daylight::badge>
                @else
                    <x-daylight::badge class="bg-gray-100 text-gray-700">
                        {{ __('daylight::forms.inactive') }}
                    </x-daylight::badge>
                @endif
            </x-daylight::tables.column>

            <x-daylight::tables.column>
                {{ $row->submissions_count }}
            </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.forms.edit', $row)"
                    :can-duplicate="false"
                    :can-delete="true"
                    :row-id="$row->id"
                />
            </x-slot:actions>
        </x-daylight::tables.row>
    @endforeach
</x-daylight::tables.table>
