@extends('layouts.parent')
@section('title', 'Exams')
@section('content')
    <x-page-head title="Exams" :subtitle="$activeChild?->full_name" />
    <x-child-switcher :students="$students" :active-child="$activeChild" />
    <x-panel>@if($exams->isEmpty())<x-empty-state title="No exams" />@else<div class="table-wrap"><table><thead><tr><th>Subject</th><th>Date</th><th>Time</th><th>Room</th></tr></thead><tbody>
        @foreach($exams as $exam)<tr><td>{{ $exam->subject?->name ?? $exam->title }}</td><td>{{ optional($exam->assessment_date)->format('d M Y') }}</td><td>@if($exam->start_time){{ Str::substr($exam->start_time, 0, 5) }}@endif</td><td>{{ $exam->room ?? '—' }}</td></tr>@endforeach
    </tbody></table></div>{{ $exams->links() }}@endif</x-panel>
@endsection
