forked from Dshield-xyz/Dshield
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBadge.tsx
More file actions
25 lines (22 loc) · 725 Bytes
/
Copy pathBadge.tsx
File metadata and controls
25 lines (22 loc) · 725 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
import { cva, type VariantProps } from "class-variance-authority";
import { cn } from "@/lib/cn";
const badge = cva(
"inline-block rounded-full px-2.5 py-0.5 text-xs font-medium",
{
variants: {
tone: {
green: "bg-green-900/30 text-green-400",
blue: "bg-blue-900/30 text-blue-400",
purple: "bg-purple-900/30 text-purple-400",
zinc: "bg-zinc-800 text-zinc-300",
},
},
defaultVariants: { tone: "zinc" },
},
);
export interface BadgeProps
extends React.HTMLAttributes<HTMLSpanElement>,
VariantProps<typeof badge> {}
export function Badge({ className, tone, ...props }: BadgeProps) {
return <span className={cn(badge({ tone }), className)} {...props} />;
}