@using MP.MONO.UI.Components @using MP.MONO.Core.DTO @using MP.MONO.UI.Data @inject CurrentDataService MMDataService @if (@dataLoaded && currProd != null) { } else { } @code { protected bool dataLoaded = false; private ProductionDTO? currProd { get; set; } = null; protected override async Task OnInitializedAsync() { await ReloadData(); } protected string percProgress(int num, int den) { string answ = "width: 0%;"; den = den != 0 ? den : 1; double ratio = ((double)num) / den; answ = $"width: {ratio:P0};"; return answ; } protected async Task ReloadData() { await Task.Delay(10); currProd = await MMDataService.MachineProd(); await Task.Delay(500); dataLoaded = true; } }