@model PlanTempus.Application.Features.Customers.Components.CustomerItemViewModel

<swp-data-table-row data-name="@Model.FullName" data-visits="@Model.Visits" data-href="/kunder/@Model.Id">
    <swp-data-table-cell>
        <swp-avatar class="@Model.AvatarColor">@Model.Initials</swp-avatar>
        <swp-quick-view-btn data-drawer-trigger="customer-drawer">
            <i class="ph ph-sidebar"></i>
        </swp-quick-view-btn>
        <span>@Model.FullName</span>
    </swp-data-table-cell>
    <swp-data-table-cell>@Model.Phone</swp-data-table-cell>
    <swp-data-table-cell>@Model.Email</swp-data-table-cell>
    <swp-data-table-cell>@Model.Visits</swp-data-table-cell>
    <swp-data-table-cell>@Model.LastVisit</swp-data-table-cell>
    <swp-data-table-cell>@Model.PreferredHairdresser</swp-data-table-cell>
    <swp-data-table-cell>@Model.CreatedAt</swp-data-table-cell>
    <swp-data-table-cell>
        @foreach (var tag in Model.Tags)
        {
            <swp-tag class="@tag">@GetTagLabel(tag)</swp-tag>
        }
    </swp-data-table-cell>
</swp-data-table-row>

@functions {
    string GetTagLabel(string tag)
    {
        return tag switch
        {
            "vip" => "VIP",
            "ny" => "Ny",
            "allergi" => "Allergi",
            "sensitiv" => "Sensitiv",
            "stamkunde" => "Stamkunde",
            _ => tag
        };
    }
}
