From a764bde89949bba57514e73d979c9961a323c53f Mon Sep 17 00:00:00 2001 From: YangJinSoo94 Date: Thu, 27 Mar 2025 16:34:41 +0900 Subject: [PATCH] =?UTF-8?q?modal=20=EC=88=98=EC=A0=95=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/ui/alert_dialog_ui/index.tsx | 71 ++++++++++++------- 1 file changed, 45 insertions(+), 26 deletions(-) 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} + + + + + )} ); }