"use client"; import { XCircle } from "@phosphor-icons/react/dist/ssr/XCircle"; import clsx from "clsx"; import type { ComponentProps, ReactNode } from "react"; import { Heading } from "react-aria-components"; import styles from "./index.module.scss"; import { Button } from "../Button/index.js"; import { ModalDialog } from "../ModalDialog/index.js"; export { ModalDialogTrigger as AlertTrigger } from "../ModalDialog/index.js"; const CLOSE_DURATION_IN_S = 0.1; export const CLOSE_DURATION_IN_MS = CLOSE_DURATION_IN_S * 1000; type OwnProps = Pick, "children"> & { icon?: ReactNode | undefined; title: ReactNode; bodyClassName?: string | undefined; }; type Props = Omit< ComponentProps, keyof OwnProps | "overlayClassName" > & OwnProps; export const Alert = ({ icon, title, children, className, bodyClassName, ...props }: Props) => ( {(...args) => ( <> {icon &&
{icon}
}
{title}
{typeof children === "function" ? children(...args) : children}
)}
);