import classnames from 'classnames'; import { motion } from 'framer-motion'; import { useMemo } from 'react'; import type { ReactNode } from 'react'; import { Overlay } from '../Overlay'; import { IconButton } from './IconButton'; import { HStack, VStack } from './Stacks'; export interface DialogProps { children: ReactNode; open: boolean; onClose: () => void; title: ReactNode; description?: ReactNode; className?: string; wide?: boolean; hideX?: boolean; } export function Dialog({ children, className, wide, 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}
); }