import clsx from "clsx"; import CheckCircle from "../../icons/check-circle"; import Information from "../../icons/information"; import Stop from "../../icons/stop"; import Warning from "../../icons/warning"; import styles from "./Note.module.css"; interface Props { size?: "small" | "large"; /** * action={} */ action?: React.ReactNode; type?: "secondary" | "success" | "error" | "warning" | "violet" | "cyan"; label?: false | string; /** @deprecated */ small?: boolean; fill?: boolean; style?: React.CSSProperties; disabled?: boolean; } const Icon = ({ type }: { type?: Props["type"] }) => { let icon = null; if (!type || type === "secondary" || type === "violet" || type === "cyan") { icon = ; } if (type === "success") { icon = ; } if (type === "warning") { icon = ; } if (type === "error") { icon = ; } return ( {icon} ); }; const Note: React.FC> = ({ children, size, label, action, type, fill, style, // for mdx disabled, }) => { return (
{typeof label === "string" ? ( {label} ) : null} {label === false ? undefined : null} {label === undefined ? : null} {children} {action &&
{action}
}
); }; export default Note;