import React from 'react'; import { Button, Modal } from 'react-bootstrap'; import constants from 'utils/strings/constants'; export interface MessageAttributes { title?: string; staticBackdrop?: boolean; nonClosable?: boolean; content?: any; close?: { text?: string; variant?: string; action?: () => void }; proceed?: { text: string; action: () => void; variant: string; disabled?: boolean; }; } export type SetDialogMessage = React.Dispatch< React.SetStateAction >; type Props = React.PropsWithChildren<{ show: boolean; onHide: () => void; attributes: MessageAttributes; size?: 'sm' | 'lg' | 'xl'; }>; export default function MessageDialog({ attributes, children, ...props }: Props) { if (!attributes) { return ; } return ( null : props.onHide} centered backdrop={attributes.staticBackdrop ? 'static' : 'true'}> {attributes.title && ( {attributes.title} )} {(children || attributes?.content) && ( {children || (

{attributes.content}

)}
)} {(attributes.close || attributes.proceed) && (
{attributes.close && ( )} {attributes.proceed && ( )}
)}
); }