Spaces:
Runtime error
Runtime error
| 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 rounded-full px-3 py-1 text-xs font-semibold", | |
| { | |
| variants: { | |
| variant: { | |
| default: "bg-[var(--muted)] text-[var(--foreground)]", | |
| accent: "bg-[var(--accent-soft)] text-[var(--accent)]", | |
| outline: "border border-[var(--border)] bg-white text-[var(--foreground-muted)]", | |
| }, | |
| }, | |
| 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 }; | |