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