import { GoPrimitiveDot } from "react-icons/go"; import classNames from "@calcom/lib/classNames"; import { SVGComponent } from "@calcom/types/SVGComponent"; const badgeClassNameByVariant = { default: "bg-orange-100 text-orange-800", warning: "bg-orange-100 text-orange-800", orange: "bg-orange-100 text-orange-800", success: "bg-green-100 text-green-800", green: "bg-green-100 text-green-800", gray: "bg-gray-100 text-gray-800 dark:bg-transparent dark:text-darkgray-800 group-hover:bg-gray-200 dark:group-hover:bg-darkgray-200", blue: "bg-blue-100 text-blue-800", red: "bg-red-100 text-red-800", error: "bg-red-100 text-red-800", }; const classNameBySize = { default: "h-5", lg: "h-6", }; export type BadgeProps = { variant: keyof typeof badgeClassNameByVariant; size?: keyof typeof classNameBySize; StartIcon?: SVGComponent; bold?: boolean; withDot?: boolean; rounded?: boolean; } & JSX.IntrinsicElements["div"]; export const Badge = function Badge(props: BadgeProps) { const { variant = "default", className, size = "default", rounded, StartIcon, withDot, bold, ...passThroughProps } = props; const hasIconOrDot = StartIcon || withDot; return (
<> {StartIcon && } {withDot && } {props.children}
); };