File size: 525 Bytes
ea934b5 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | import React from "react";
const variants = {
default: "bg-black text-white",
secondary: "bg-gray-200 text-gray-900",
success: "bg-green-100 text-green-800",
warning: "bg-yellow-100 text-yellow-800",
destructive: "bg-red-100 text-red-700",
};
export function Badge({ variant = "default", className = "", ...props }) {
const v = variants[variant] || variants.default;
return (
<span className={`inline-flex items-center px-2.5 py-1 rounded-full text-xs font-medium ${v} ${className}`} {...props} />
);
}
|