refactor(dashboard): StatusBadge delegates to ZB.MOM.WW.Theme StatusPill
This commit is contained in:
@@ -1,16 +1,16 @@
|
||||
<span class="chip @CssClass">@Text</span>
|
||||
|
||||
@* Thin adapter: maps MxGateway runtime state text → kit StatusPill state.
|
||||
The bespoke .chip rendering now lives in the kit; only the app's domain
|
||||
text→state vocabulary remains here. Call sites (<StatusBadge Text="..."/>) unchanged. *@
|
||||
<StatusPill State="MapState(Text)">@Text</StatusPill>
|
||||
@code {
|
||||
[Parameter]
|
||||
public string? Text { get; set; }
|
||||
[Parameter] public string? Text { get; set; }
|
||||
|
||||
private string CssClass => Text switch
|
||||
private static StatusState MapState(string? text) => text switch
|
||||
{
|
||||
"Ready" or "Healthy" or "Active" => "chip-ok",
|
||||
"Creating" or "StartingWorker" or "WaitingForPipe" or "InitializingWorker" or "Closing" => "chip-warn",
|
||||
"Stale" or "Degraded" => "chip-warn",
|
||||
"Faulted" or "Unavailable" => "chip-bad",
|
||||
"Closed" or "Revoked" or "Unknown" => "chip-idle",
|
||||
_ => "chip-idle"
|
||||
"Ready" or "Healthy" or "Active" => StatusState.Ok,
|
||||
"Creating" or "StartingWorker" or "WaitingForPipe" or "InitializingWorker" or "Closing"
|
||||
or "Stale" or "Degraded" => StatusState.Warn,
|
||||
"Faulted" or "Unavailable" => StatusState.Bad,
|
||||
_ => StatusState.Idle,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user