feat(theme): StatusPill widget
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
@* Components/StatusPill.razor *@
|
||||
<span class="chip @ChipClass">@ChildContent</span>
|
||||
|
||||
@code {
|
||||
[Parameter, EditorRequired] public StatusState State { get; set; }
|
||||
[Parameter] public RenderFragment? ChildContent { get; set; }
|
||||
|
||||
private string ChipClass => State switch
|
||||
{
|
||||
StatusState.Ok => "chip-ok",
|
||||
StatusState.Warn => "chip-warn",
|
||||
StatusState.Bad => "chip-bad",
|
||||
StatusState.Info => "chip-info",
|
||||
_ => "chip-idle",
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
namespace ZB.MOM.WW.Theme;
|
||||
|
||||
public enum StatusState { Ok, Warn, Bad, Idle, Info }
|
||||
@@ -2,3 +2,4 @@
|
||||
@using Microsoft.AspNetCore.Components.Routing
|
||||
@using Microsoft.AspNetCore.Components.Web
|
||||
@using ZB.MOM.WW.Theme
|
||||
@using ZB.MOM.WW.Theme.Components
|
||||
|
||||
Reference in New Issue
Block a user