18 lines
523 B
TypeScript
18 lines
523 B
TypeScript
import type { HTMLAttributes } from "react";
|
|
import { cn } from "./cn.js";
|
|
|
|
export type StatusTone = "neutral" | "success" | "warning" | "danger" | "accent";
|
|
|
|
export interface StatusBadgeProps extends HTMLAttributes<HTMLSpanElement> {
|
|
tone?: StatusTone;
|
|
}
|
|
|
|
export function StatusBadge({ tone = "neutral", className, children, ...props }: StatusBadgeProps) {
|
|
return (
|
|
<span className={cn("nodedc-status", className)} data-tone={tone === "neutral" ? undefined : tone} {...props}>
|
|
{children}
|
|
</span>
|
|
);
|
|
}
|
|
|