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 {
|
@code {
|
||||||
[Parameter]
|
[Parameter] public string? Text { get; set; }
|
||||||
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",
|
"Ready" or "Healthy" or "Active" => StatusState.Ok,
|
||||||
"Creating" or "StartingWorker" or "WaitingForPipe" or "InitializingWorker" or "Closing" => "chip-warn",
|
"Creating" or "StartingWorker" or "WaitingForPipe" or "InitializingWorker" or "Closing"
|
||||||
"Stale" or "Degraded" => "chip-warn",
|
or "Stale" or "Degraded" => StatusState.Warn,
|
||||||
"Faulted" or "Unavailable" => "chip-bad",
|
"Faulted" or "Unavailable" => StatusState.Bad,
|
||||||
"Closed" or "Revoked" or "Unknown" => "chip-idle",
|
_ => StatusState.Idle,
|
||||||
_ => "chip-idle"
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user