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