import { Dialog as BaseDialog } from '@base-ui/react/dialog'; import type { ReactNode } from 'react'; import { IoClose } from 'react-icons/io5'; import { cx } from '../../utils/styleUtils'; import IconButton from '../buttons/IconButton'; import style from './Modal.module.scss'; interface ModalProps { isOpen: boolean; title?: string; showCloseButton?: boolean; showBackdrop?: boolean; size?: 'default' | 'wide'; bodyElements: ReactNode; footerElements?: ReactNode; onClose: () => void; } export default function Modal({ isOpen, title, showCloseButton, showBackdrop, size = 'default', bodyElements, footerElements, onClose, }: ModalProps) { return ( { if (!isOpen) onClose(); }} disablePointerDismissal > {showBackdrop && }
{title ? {title} :
} {showCloseButton && ( )}
{bodyElements}
{footerElements ?
{footerElements}
: null} ); }