Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 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 26 27 28 | 105x 105x | import { cva, type VariantProps } from "class-variance-authority";
import { cn } from "@/utils";
const statusLabelVariants = cva("px-2 mr-2 font-light text-white rounded-[2px]", {
variants: {
type: {
New: "bg-blue-700",
Updated: "bg-green-700",
},
},
defaultVariants: {
type: "New",
},
});
export type StatusLabelVariant = "New" | "Updated";
interface StatusLabelProps extends VariantProps<typeof statusLabelVariants> {
className?: string;
}
const StatusLabel = ({ type, className }: StatusLabelProps) => {
return <span className={cn(statusLabelVariants({ type }), className)}>{type}</span>;
};
export default StatusLabel;
|