import { type ReactNode } from 'react'; import { Dialog as MuiDialog, type DialogProps, DialogTitle, DialogContent, DialogActions, IconButton, Box } from '@mui/material'; import CloseIcon from '@mui/icons-material/Close'; import RdsButton from '../rds-button/rds-button'; import './rds-dialog.scss'; const SIZE_MAP = { 'extra-small': 'xs', 'small': 'sm', 'medium': 'md', 'large': 'lg', 'extra-large': 'xl', } as const; export interface RdsDialogProps extends Omit { title?: string; children?: ReactNode; actions?: ReactNode; ShowDissmiss?: boolean; onClose?: () => void; variant?: 'standard' | 'default'; ShowPrimary?: boolean; ShowSecondary?: boolean; showTitle?: boolean; size?: 'extra-small' | 'small' | 'medium' | 'large' | 'extra-large' | false; } const RdsDialog = ({ title, children, actions, ShowDissmiss = true, onClose, variant = 'default', ShowPrimary, ShowSecondary, showTitle = true, size = 'medium', ...props }:RdsDialogProps) => { if (variant === 'standard') { return ( {((title && showTitle) || ShowDissmiss) && (
{showTitle ? title : null}
{ShowDissmiss && ( )}
)} {children} {ShowSecondary && ( Cancel )} {ShowPrimary && ( )}
); } return ( {((title && showTitle) || ShowDissmiss) && ( {showTitle ? title : null} {ShowDissmiss && onClose && ( )} )} {children} {actions && ( {actions} )} ); }; RdsDialog.displayName = 'RdsDialog'; export default RdsDialog;