| import * as React from "react" | |
| import { cva, type VariantProps } from "class-variance-authority" | |
| import { cn } from "@/lib/utils" | |
| const badgeVariants = cva( | |
| "inline-flex items-center gap-1.5 rounded-full border px-2.5 py-0.5 text-[0.6875rem] font-medium font-mono uppercase tracking-wider transition-colors", | |
| { | |
| variants: { | |
| variant: { | |
| default: "border-border bg-white/5 text-muted-foreground", | |
| live: "border-primary/40 bg-primary/10 text-primary", | |
| warning: "border-warning/40 bg-warning/10 text-warning", | |
| info: "border-info/40 bg-info/10 text-info", | |
| danger: "border-destructive/40 bg-destructive/10 text-destructive", | |
| }, | |
| }, | |
| defaultVariants: { variant: "default" }, | |
| }, | |
| ) | |
| function Badge({ | |
| className, | |
| variant, | |
| ...props | |
| }: React.ComponentProps<"span"> & VariantProps<typeof badgeVariants>) { | |
| return <span className={cn(badgeVariants({ variant }), className)} {...props} /> | |
| } | |
| export { Badge, badgeVariants } | |