import { Breakpoint, Button, DialogActions, DialogContent, DialogProps, Typography, } from "@mui/material"; import { t } from "i18next"; import React from "react"; import DialogIcon from "./DialogIcon"; import DialogTitleWithCloseButton, { dialogCloseHandler, } from "./TitleWithCloseButton"; import DialogBoxBase from "./base"; import { DialogBoxAttributes } from "./types"; type IProps = React.PropsWithChildren< Omit & { onClose: () => void; attributes: DialogBoxAttributes; size?: Breakpoint; titleCloseButton?: boolean; } >; export default function DialogBox({ attributes, children, open, size, onClose, titleCloseButton, ...props }: IProps) { if (!attributes) { return <>; } const handleClose = dialogCloseHandler({ staticBackdrop: attributes.staticBackdrop, nonClosable: attributes.nonClosable, onClose: onClose, }); return ( {attributes.icon && } {attributes.title && ( {attributes.title} )} {(children || attributes?.content) && ( {children || ( {attributes.content} )} )} {(attributes.close || attributes.proceed) && ( <> {attributes.close && ( )} {attributes.proceed && ( )} {attributes.secondary && ( )} )} ); }