@model IEnumerable<EventRegistrationDto>
@{
    ViewData["Title"] = "Student Registrations";
    var studentName = ViewBag.StudentName as string;
}

<h2>Registrations for @studentName</h2>
<hr />

<table class="table table-striped table-hover">
    <thead class="table-dark">
        <tr><th>Event</th><th>Level</th><th>Registered</th><th>Score</th><th>Placement</th></tr>
    </thead>
    <tbody>
        @foreach (var r in Model)
        {
            <tr>
                <td>@r.EventName</td>
                <td>@r.EventLevelName</td>
                <td>@r.RegisteredAt.ToString("MMM d, yyyy")</td>
                <td>@(r.Score?.RawPerformance.ToString() ?? "-")</td>
                <td>@(r.Score?.Placement?.ToString() ?? "-")</td>
            </tr>
        }
    </tbody>
</table>

<a asp-controller="Student" asp-action="Index" class="btn btn-secondary">Back to Students</a>
