@inherits ComponentBase

<TableContainer T="ViewModel"
                @ref="Container"
                @bind-Search="Search"
                Title="@Title"
                Breadcrumbs="@Breadcrumbs"
                Data="LoadDataAsync">
    <Header>
        <MudTh>
            <MudTableSortLabel SortLabel="Customer" T="ViewModel">
                Customer
            </MudTableSortLabel>
        </MudTh>
        <MudTh>
            <MudTableSortLabel SortLabel="Host" T="ViewModel">
                Host
            </MudTableSortLabel>
        </MudTh>
        <MudTh>
            <MudTableSortLabel SortLabel="Name" T="ViewModel">
                Drive
            </MudTableSortLabel>
        </MudTh>
        <MudTh>
            <MudTableSortLabel SortLabel="Firmware" T="ViewModel">
                Firmware
            </MudTableSortLabel>
        </MudTh>
        <MudTh>
            <MudTableSortLabel SortLabel="Serial" T="ViewModel">
                Serial
            </MudTableSortLabel>
        </MudTh>
        <MudTh>
            <MudTableSortLabel SortLabel="Size" T="ViewModel">
                Size
            </MudTableSortLabel>
        </MudTh>
        <MudTh>
            <MudTableSortLabel SortLabel="Status" T="ViewModel">
                Status
            </MudTableSortLabel>
        </MudTh>
    </Header>
    <RowTemplate>
        <MudTd DataLabel="Customer">
            <MudLink Href="@Navigation.Management.Customers.DetailsHref(context?.Customer?.Id)" Typo="Typo.inherit" Underline="Underline.None">
                @context?.Customer?.Name
            </MudLink>
        </MudTd>
        <MudTd DataLabel="Host">
            <MudLink Href="@Navigation.Management.Hosts.DetailsHref(context?.Host?.Id)" Typo="Typo.inherit" Underline="Underline.None">
                @context?.Host?.Name
            </MudLink>
        </MudTd>
        <MudTd DataLabel="Name">
            @context?.Name
        </MudTd>
        <MudTd DataLabel="Firmware">
            @context?.Firmware
        </MudTd>
        <MudTd DataLabel="Serial">
            @context?.Serial
        </MudTd>
        <MudTd DataLabel="Size">
            @{
                double? size = null;
                var value = "-";

                if (context?.Size is not null)
                {
                    size = Math.Round((context.Size.Value / Math.Pow(1024, 3)), 2);
                    value = $"{size} GB";
                }

                @value
            }
        </MudTd>
        <MudTd DataLabel="Status">
            @{
                var color = context?.Status == "OK" ? Color.Success : Color.Error;
                <MudText Color="color" Typo="Typo.inherit">@context?.Status</MudText>
            }
        </MudTd>
    </RowTemplate>
</TableContainer>