-
-
Notifications
You must be signed in to change notification settings - Fork 26
Expand file tree
/
Copy pathNavItemBadge.razor
More file actions
32 lines (28 loc) · 987 Bytes
/
NavItemBadge.razor
File metadata and controls
32 lines (28 loc) · 987 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
@namespace LumexUI.Docs.Client.Components
@if( Status.HasValue )
{
<span class="@RootClasses">
@Status.ToString()
</span>
}
@code {
[Parameter] public PageStatus? Status { get; set; }
private string? RootClasses => ElementClass.Empty()
.Add( "px-1.5" )
.Add( "py-[3px]" )
.Add( "rounded-full" )
.Add( "ring" )
.Add( "font-semibold" )
.Add( "text-[9px]" )
.Add( "uppercase" )
.Add( "leading-none" )
.Add( _variants[Status!.Value], when: Status.HasValue )
.ToString();
private static readonly Dictionary<PageStatus, string> _variants = new()
{
[PageStatus.New] = "bg-orange-100 ring-orange-300 text-orange-600",
[PageStatus.Soon] = "bg-foreground-100 ring-foreground-300 text-foreground-600",
[PageStatus.Preview] = "bg-indigo-50 ring-indigo-200 text-indigo-600",
[PageStatus.Updated] = "bg-teal-50 ring-teal-200 text-teal-600",
};
}