@page "/anomalies/{Id:guid}" @using Marathon.UI.Components @inject IStringLocalizer L @inject IAnomalyBrowsingService Anomalies @inject NavigationManager Nav @L["App.Title"] · @L["Anomaly.Title"]
@if (_loading && _detail is null) {
@L["Common.Loading"]
} else if (_detail is null) {
404

@L["Anomaly.Detail.NotFound"]

@L["Anomaly.Detail.BackToFeed"]
} else {
@KindLabel(_detail.Item.Kind) · @_detail.Item.CountryCode · @_detail.Item.LeagueId

@_detail.Item.EventTitle

@L["Anomaly.Card.DetectedAt"] @_detail.Item.DetectedAt.ToString("dd MMM yyyy · HH:mm:ss") · MSK

@L["Anomaly.Detail.EvidenceTitle"]
}
@code { [Parameter] public Guid Id { get; set; } private AnomalyDetailVm? _detail; private bool _loading = true; protected override async Task OnParametersSetAsync() { _loading = true; try { _detail = await Anomalies.GetByIdAsync(Id, CancellationToken.None); } catch { _detail = null; } finally { _loading = false; } } private string KindLabel(AnomalyKind kind) => kind switch { AnomalyKind.SuspensionFlip => L["Anomaly.Kind.SuspensionFlip"], AnomalyKind.SteamMove => L["Anomaly.Kind.SteamMove"], _ => kind.ToString(), }; private static string FormatGap(int seconds) { if (seconds <= 0) return "—"; var ts = TimeSpan.FromSeconds(seconds); if (ts.TotalSeconds < 60) return string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0}s", (int)ts.TotalSeconds); if (ts.TotalMinutes < 60) return string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0}m {1:00}s", (int)ts.TotalMinutes, ts.Seconds); return string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0}h {1:00}m", (int)ts.TotalHours, ts.Minutes); } }