<x-admin-layout title="Contact Submissions">
    <x-admin.panel>
        <x-admin.table-toolbar title="All Contact Submissions" :total="$items->count()" />
        <x-admin.table>
            <thead>
                <tr class="border-b border-gray-100 bg-gray-50/60">
                    <th class="text-left px-3 py-3 text-xs font-semibold text-gray-500 uppercase tracking-wide">Name</th>
                    <th class="text-left px-3 py-3 text-xs font-semibold text-gray-500 uppercase tracking-wide">Email</th>
                    <th class="text-left px-3 py-3 text-xs font-semibold text-gray-500 uppercase tracking-wide">Interest</th>
                    <th class="text-left px-3 py-3 text-xs font-semibold text-gray-500 uppercase tracking-wide">Date</th>
                    <th class="w-24 px-3 py-3"></th>
                </tr>
            </thead>
            <tbody class="divide-y divide-gray-50">
                @foreach ($items as $item)
                    <tr class="admin-table-row group">
                        <td class="px-3 py-3 font-medium text-gray-800">{{ trim($item->first_name.' '.$item->last_name) }}</td>
                        <td class="px-3 py-3 text-gray-500">{{ $item->email }}</td>
                        <td class="px-3 py-3 text-gray-500">{{ $item->interest }}</td>
                        <td class="px-3 py-3 text-gray-500">{{ $item->created_at?->format('Y-m-d H:i') }}</td>
                        <x-admin.row-actions
                            :view-route="route('admin.contact-submissions.show', $item)"
                            :destroy-route="route('admin.contact-submissions.destroy', $item)"
                        />
                    </tr>
                @endforeach
            </tbody>
        </x-admin.table>
        <x-admin.table-footer :count="$items->count()" noun="submissions" />
    </x-admin.panel>
</x-admin-layout>
