import React from 'react'; import { Button, Modal } from 'react-bootstrap'; import constants from 'utils/strings/constants'; export interface MessageAttributes { title?: string; staticBackdrop?: boolean; content?: any; close?: { text?: string; variant?: string }; proceed?: { text: string; action: any; 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 ( {attributes.title && ( {attributes.title} )} {(children || attributes?.content) && ( {children ? children :
{attributes.content}
}
)} {attributes.close && ( )} {attributes.proceed && ( )}
); }