import classNames from "classnames"; import type { ReactNode } from "react"; import { forwardRef } from "react"; import type { IconType } from "react-icons"; import { CheckCircle2, Info, XCircle, AlertTriangle } from "@calcom/ui/components/icon"; export interface AlertProps { title?: ReactNode; // @TODO: Message should be children, more flexible? message?: ReactNode; // @TODO: Provide action buttons so style is always the same. actions?: ReactNode; className?: string; iconClassName?: string; // @TODO: Success and info shouldn't exist as per design? severity: "success" | "warning" | "error" | "info" | "neutral"; CustomIcon?: IconType; customIconColor?: string; } export const Alert = forwardRef((props, ref) => { const { severity, iconClassName, CustomIcon, customIconColor } = props; return (
{CustomIcon ? (
) : (
{severity === "error" && (
)}

{props.title}

{props.message}
{props.actions &&
{props.actions}
}
); }); Alert.displayName = "Alert";