diff --git a/packages/common/business_components/src/ui/alert_dialog_ui/index.tsx b/packages/common/business_components/src/ui/alert_dialog_ui/index.tsx index 58b69cff6..27c67458d 100644 --- a/packages/common/business_components/src/ui/alert_dialog_ui/index.tsx +++ b/packages/common/business_components/src/ui/alert_dialog_ui/index.tsx @@ -1,33 +1,52 @@ -import { Button, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger } from "@common/components"; +import { Button, Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger } from "@common/components"; - -type ModalType={ - bodyClass:string - butNm:string - title:string - body:React.ReactNode +type ModalType = { + bodyClass: string; + butNm: string; + title: string; + body: React.ReactNode; + open?: boolean; + onOpenChange?: (open: boolean) => void; } -export function UiModal({bodyClass,butNm,title ,body}:ModalType ) { + +export function UiModal({ bodyClass, butNm, title, body, open, onOpenChange }: ModalType) { + const dialogProps = open !== undefined && onOpenChange !== undefined + ? { open, onOpenChange } + : {}; + return ( <> - - - - - - - {title} - - - - {body} - - - - - - - + {!open && ( + + + + + + + {title} + + + + {body} + + + + + )} + {open && ( + + + + {title} + + + + {body} + + + + + )} ); }