@extends('layouts.app')

@section('title', 'Teacher Dashboard')

@section('content')
    <h1 class="text-2xl font-bold mb-6">Teacher Dashboard</h1>
    <div class="grid grid-cols-1 md:grid-cols-3 gap-4 mb-8">
        <div class="bg-blue-100 p-4 rounded-lg shadow">
            <h3 class="font-bold">My Classes</h3>
            <p class="text-2xl">{{ $myClasses->count() }}</p>
        </div>
        <div class="bg-green-100 p-4 rounded-lg shadow">
            <h3 class="font-bold">Recent Assignments</h3>
            <p class="text-2xl">{{ $myAssignments->count() }}</p>
        </div>
        <div class="bg-yellow-100 p-4 rounded-lg shadow">
            <h3 class="font-bold">Recent Updates</h3>
            <p class="text-2xl">{{ $myUpdates->count() }}</p>
        </div>
    </div>

    <h2 class="text-xl font-semibold mb-4">Your Classes</h2>
    <ul class="list-disc pl-5 mb-6">
        @foreach($myClasses as $class)
            <li>{{ $class->name }} ({{ $class->code }})</li>
        @endforeach
    </ul>

    <h2 class="text-xl font-semibold mb-4">Recent Assignments</h2>
    <ul class="list-disc pl-5">
        @foreach($myAssignments as $assignment)
            <li>{{ $assignment->title }} - Deadline: {{ $assignment->deadline->format('M d, Y') }}</li>
        @endforeach
    </ul>
@endsection