Files
BQP/srcs/RobotNet10/FleetManager/RobotNet10.FleetManager.Client/Components/RobotDetail/LoadsCard.razor
2026-07-13 09:25:40 +07:00

59 lines
2.3 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
@using RobotNet.VDA5050.State
<MudPaper Class="pa-4" Elevation="2">
<MudText Typo="Typo.h6" Class="mb-3">Loads</MudText>
@if (State?.Loads != null && State.Loads.Length > 0)
{
<MudTable Items="@State.Loads" T="Load" Hover="true" Dense="true" Height="400px" FixedHeader="true" Elevation="0">
<HeaderContent>
<MudTh>Load ID</MudTh>
<MudTh>Load Type</MudTh>
<MudTh>Position</MudTh>
<MudTh>Weight</MudTh>
<MudTh>Dimensions</MudTh>
</HeaderContent>
<RowTemplate>
<MudTd DataLabel="Load ID">
<MudText Typo="Typo.body2" Style="max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;">
@(context.LoadId ?? "N/A")
</MudText>
</MudTd>
<MudTd DataLabel="Load Type">@(context.LoadType ?? "N/A")</MudTd>
<MudTd DataLabel="Position">@(context.LoadPosition ?? "N/A")</MudTd>
<MudTd DataLabel="Weight">@(context.Weight > 0 ? context.Weight?.ToString("F2") + " kg" : "N/A")</MudTd>
<MudTd DataLabel="Dimensions">
@if (context.LoadDimensions != null)
{
<MudText Typo="Typo.body2">
@($"{context.LoadDimensions.Length:F2} × {context.LoadDimensions.Width:F2}")
@if (context.LoadDimensions.Height > 0)
{
<text> × @context.LoadDimensions.Height.ToString("F2")</text>
}
<text> m</text>
</MudText>
}
else
{
<MudText Typo="Typo.body2">N/A</MudText>
}
</MudTd>
</RowTemplate>
</MudTable>
}
else
{
<MudText Typo="Typo.body2" Align="Align.Center">No loads available</MudText>
}
</MudPaper>
@code {
public StateMsg? State { get; set; }
public void Update(StateMsg? state)
{
State = state;
StateHasChanged();
}
}