@extends('layouts.app')
@section('title', 'Grades')
@section('content')
    <x-page-head title="Grades" subtitle="Marksheets & reports">
        <x-slot:actions>
            <a href="{{ route('school.grades.entry') }}" class="btn btn-primary">Enter Scores</a>
            <a href="{{ route('school.grading-scales.index') }}" class="btn btn-outline">Grading Scale</a>
            <a href="{{ route('school.report-cards.index') }}" class="btn btn-outline">Report Cards</a>
        </x-slot:actions>
    </x-page-head>
    <x-panel>
        @if ($entries->isEmpty())
            <x-empty-state title="No gradebook entries" message="Record assessment scores and compile marksheets." />
        @else
            <div class="table-wrap"><table><thead><tr><th>Student</th><th>Subject</th><th>Assessment</th><th>Score</th><th>Grade</th></tr></thead><tbody>
                @foreach ($entries as $entry)
                    <tr>
                        <td>{{ $entry->student?->full_name }}</td>
                        <td>{{ $entry->assessment?->subject?->name ?? '—' }}</td>
                        <td>{{ $entry->assessment?->title ?? '—' }}</td>
                        <td>{{ $entry->score ?? '—' }}</td>
                        <td>{{ $entry->grade_letter ?? '—' }}</td>
                    </tr>
                @endforeach
            </tbody></table></div>
            <div style="margin-top:16px;">{{ $entries->links() }}</div>
        @endif
    </x-panel>
@endsection
