@* Displays a UTC DateTimeOffset formatted for display. Tooltip shows UTC value.
   A null Value renders as a plain "never" placeholder — used for timestamps that
   have not happened yet (e.g. a heartbeat-only site with no full report). *@

@if (Value is { } value)
{
    <span title="@value.UtcDateTime.ToString("yyyy-MM-dd HH:mm:ss") UTC">@value.LocalDateTime.ToString(Format)</span>
}
else
{
    <span class="text-muted">@NullText</span>
}

@code {
    [Parameter, EditorRequired] public DateTimeOffset? Value { get; set; }
    [Parameter] public string Format { get; set; } = "yyyy-MM-dd HH:mm:ss";

    /// <summary>Text shown when <see cref="Value"/> is null.</summary>
    [Parameter] public string NullText { get; set; } = "never";
}
