Files
formbricks/packages/ui/components/Badge.tsx
Johannes fbcc9d5628 Update Docs, add Walkthrough Video to App & LP (#212)
* update LP with walk through

* update docs with attributes and events

* update team UI + form validation

* add walk through to app

* small fixes

---------

Co-authored-by: Matthias Nannt <mail@matthiasnannt.com>
2023-03-30 17:24:04 +02:00

43 lines
869 B
TypeScript

import { cn } from "@formbricks/lib/cn";
interface BadgeProps {
text: string;
type: "warning" | "success" | "error";
size: "tiny" | "normal" | "large";
}
export function Badge({ text, type, size }: BadgeProps) {
const bgColor = {
warning: "bg-amber-100",
success: "bg-green-100",
error: "bg-red-100",
};
const textColor = {
warning: "text-amber-800",
success: "text-green-800",
error: "text-red-800",
};
const padding = {
tiny: "px-1.5 py-0.5",
normal: "px-2.5 py-0.5",
large: "px-3.5 py-1",
};
const textSize = size === "large" ? "text-sm" : "text-xs";
return (
<span
className={cn(
"ml-2 inline-flex cursor-default items-center rounded-full font-medium",
bgColor[type],
textColor[type],
padding[size],
textSize
)}>
{text}
</span>
);
}