import classnames from 'classnames'; import { motion } from 'framer-motion'; import type { ReactNode } from 'react'; import { useMemo } from 'react'; import { Overlay } from '../Overlay'; import { Heading } from './Heading'; import { IconButton } from './IconButton'; export interface DialogProps { children: ReactNode; open: boolean; onClose: () => void; title: ReactNode; description?: ReactNode; className?: string; size?: 'sm' | 'md' | 'full' | 'dynamic'; hideX?: boolean; } export function Dialog({ children, className, size = 'full', open, onClose, title, description, hideX, }: DialogProps) { const titleId = useMemo(() => Math.random().toString(36).slice(2), []); const descriptionId = useMemo( () => (description ? Math.random().toString(36).slice(2) : undefined), [description], ); return (
{!hideX && ( )} {title} {description &&

{description}

}
{children}
); }