@page "/units" @using ZeroSpace.Model @using ZeroSpace.Web.Services @using Telerik.Blazor @using Telerik.Blazor.Components @inject IUnitsApiClient UnitsApiClient Units

Units

@if (isLoading) {
Loading units...
} else if (errorMessage != null) { } else if (gearNotes == null || gearNotes.Count == 0) { } else {
} @code { private List? gearNotes; private bool isLoading = true; private string? errorMessage; protected override async Task OnInitializedAsync() { await LoadUnitsAsync(); } private async Task LoadUnitsAsync() { isLoading = true; errorMessage = null; try { var units = await UnitsApiClient.GetUnitsAsync(); gearNotes = units.ToList(); } catch (Exception ex) { errorMessage = $"Failed to load units: {ex.Message}"; } finally { isLoading = false; } } }