@extends('layouts.app')

@section('content')
<div class="container-xxl flex-grow-1 container-p-y">
    <div class="card">
        <div class="card-header">
            <h5 class="mb-0">Assignment Details</h5>
            <hr/>
        </div>

        <div class="card-body">
            <p><b>Course:</b> {{ $course->title }}</p>
            <p><b>Title:</b> {{ $assignment->title }}</p>
            <p><b>Due Date:</b> {{ $assignment->due_date ? $assignment->due_date->format('Y-m-d H:i') : 'N/A' }}</p>
            <p><b>Description:</b> {{ $assignment->description }}</p>
            <p><b>Created By:</b> {{ $assignment->creator?->name ?? 'N/A' }}</p>

            <a href="{{ route('assignments.index', $course) }}" class="btn btn-secondary">Back</a>
        </div>
    </div>
</div>
@endsection