<x-admin-layout title="Class Sessions">
    <x-admin.panel>
        <x-admin.table-toolbar
            title="All Class Sessions"
            :total="$items->count()"
            :create-route="route('admin.class-sessions.create')"
            create-label="Add Session"
        />
        <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">Class Type</th>
                    <th class="text-left px-3 py-3 text-xs font-semibold text-gray-500 uppercase tracking-wide">Coach</th>
                    <th class="text-left px-3 py-3 text-xs font-semibold text-gray-500 uppercase tracking-wide">Day</th>
                    <th class="text-left px-3 py-3 text-xs font-semibold text-gray-500 uppercase tracking-wide">Time</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">{{ $item->classType?->name }}</td>
                        <td class="px-3 py-3 text-gray-500">{{ $item->coach?->name }}</td>
                        <td class="px-3 py-3 text-gray-500 uppercase">{{ $item->day_of_week }}</td>
                        <td class="px-3 py-3 text-gray-500">{{ \Illuminate\Support\Str::of($item->start_time)->substr(0, 5) }}</td>
                        <x-admin.row-actions
                            :edit-route="route('admin.class-sessions.edit', $item)"
                            :destroy-route="route('admin.class-sessions.destroy', $item)"
                        />
                    </tr>
                @endforeach
            </tbody>
        </x-admin.table>
        <x-admin.table-footer :count="$items->count()" noun="class sessions" />
    </x-admin.panel>
</x-admin-layout>
