@model PlanTempus.Application.Features.Employees.Components.EmployeeDetailHoursViewModel

@{
    string GetBadgeClass(string status) => status switch
    {
        "work" => "",
        "off" => "off",
        "vacation" => "vacation",
        "sick" => "sick",
        _ => "off"
    };
}

<swp-schedule-scroll>
    <swp-schedule-table class="hours-view">
        <!-- Header row -->
        <swp-schedule-cell class="header week-number"></swp-schedule-cell>
    @foreach (var dayName in Model.DayNames)
    {
        <swp-schedule-cell class="header"><swp-day-name>@dayName</swp-day-name></swp-schedule-cell>
    }

    <!-- Week rows -->
    @foreach (var week in Model.Weeks)
    {
        <swp-schedule-cell class="employee week-label">
            <swp-employee-name>Uge @week.WeekNumber</swp-employee-name>
            <swp-employee-hours>@week.TotalHours @Model.LabelHours</swp-employee-hours>
        </swp-schedule-cell>
        @foreach (var day in week.Days)
        {
            <swp-schedule-cell class="day"><swp-time-badge class="@GetBadgeClass(day.Status)">@day.Display</swp-time-badge></swp-schedule-cell>
        }
    }
    </swp-schedule-table>
</swp-schedule-scroll>
