feat(ui): support a single status indicator without duplicate glyphs

This commit is contained in:
Codex
2026-09-05 23:59:49 +03:00
parent 17e150b1c7
commit 47d4f19d99
5 changed files with 16 additions and 3 deletions
+4 -3
View File
@@ -5,12 +5,13 @@ export type StatusTone = "neutral" | "success" | "warning" | "danger" | "accent"
export interface StatusBadgeProps extends HTMLAttributes<HTMLSpanElement> {
tone?: StatusTone;
variant?: "badge" | "indicator";
}
export function StatusBadge({ tone = "neutral", className, children, ...props }: StatusBadgeProps) {
export function StatusBadge({ tone = "neutral", variant = "badge", className, children, ...props }: StatusBadgeProps) {
return (
<span className={cn("nodedc-status", className)} data-tone={tone === "neutral" ? undefined : tone} {...props}>
{children}
<span className={cn("nodedc-status", className)} data-tone={tone === "neutral" ? undefined : tone} data-variant={variant === "indicator" ? variant : undefined} {...props}>
{variant === "indicator" ? null : children}
</span>
);
}