using Microsoft.AspNetCore.Mvc;
using PlanTempus.Application.Features.Localization.Services;

namespace PlanTempus.Application.Features.Employees.Components;

public class EmployeeDetailHoursViewComponent : ViewComponent
{
    private readonly ILocalizationService _localization;

    public EmployeeDetailHoursViewComponent(ILocalizationService localization)
    {
        _localization = localization;
    }

    public IViewComponentResult Invoke(string key)
    {
        var model = new EmployeeDetailHoursViewModel
        {
            LabelWeeklySchedule = _localization.Get("employees.detail.hours.weekly"),
            LabelMonday = _localization.Get("employees.detail.hours.monday"),
            LabelTuesday = _localization.Get("employees.detail.hours.tuesday"),
            LabelWednesday = _localization.Get("employees.detail.hours.wednesday"),
            LabelThursday = _localization.Get("employees.detail.hours.thursday"),
            LabelFriday = _localization.Get("employees.detail.hours.friday"),
            LabelSaturday = _localization.Get("employees.detail.hours.saturday"),
            LabelSunday = _localization.Get("employees.detail.hours.sunday")
        };

        return View(model);
    }
}

public class EmployeeDetailHoursViewModel
{
    public required string LabelWeeklySchedule { get; init; }
    public required string LabelMonday { get; init; }
    public required string LabelTuesday { get; init; }
    public required string LabelWednesday { get; init; }
    public required string LabelThursday { get; init; }
    public required string LabelFriday { get; init; }
    public required string LabelSaturday { get; init; }
    public required string LabelSunday { get; init; }
}
