import classNames from "classnames"; import type { ReactNode } from "react"; import { forwardRef } from "react"; 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"; } export const Alert = forwardRef((props, ref) => { const { severity, iconClassName } = props; return (
{severity === "error" && (

{props.title}

{props.message}
{/* @TODO: Shouldn't be absolute. This makes it harder to give margin etc. */} {props.actions &&
{props.actions}
}
); }); Alert.displayName = "Alert";