diff --git a/frontend/components/report/designer/ReportDesignerToolbar.tsx b/frontend/components/report/designer/ReportDesignerToolbar.tsx
index dba01fbb..484dae80 100644
--- a/frontend/components/report/designer/ReportDesignerToolbar.tsx
+++ b/frontend/components/report/designer/ReportDesignerToolbar.tsx
@@ -42,6 +42,16 @@ import {
DropdownMenuSeparator,
DropdownMenuTrigger,
} from "@/components/ui/dropdown-menu";
+import {
+ AlertDialog,
+ AlertDialogAction,
+ AlertDialogCancel,
+ AlertDialogContent,
+ AlertDialogDescription,
+ AlertDialogFooter,
+ AlertDialogHeader,
+ AlertDialogTitle,
+} from "@/components/ui/alert-dialog";
import { SaveAsTemplateModal } from "./SaveAsTemplateModal";
import { reportApi } from "@/lib/api/reportApi";
@@ -93,6 +103,8 @@ export function ReportDesignerToolbar() {
} = useReportDesigner();
const [showPreview, setShowPreview] = useState(false);
const [showSaveAsTemplate, setShowSaveAsTemplate] = useState(false);
+ const [showBackConfirm, setShowBackConfirm] = useState(false);
+ const [showResetConfirm, setShowResetConfirm] = useState(false);
const { toast } = useToast();
// 버튼 활성화 조건
@@ -120,16 +132,14 @@ export function ReportDesignerToolbar() {
router.push("/admin/report");
};
- const handleReset = async () => {
- if (confirm("현재 변경사항을 모두 취소하고 마지막 저장 상태로 되돌리시겠습니까?")) {
- await loadLayout();
- }
+ const handleResetConfirm = async () => {
+ setShowResetConfirm(false);
+ await loadLayout();
};
- const handleBack = () => {
- if (confirm("저장하지 않은 변경사항이 있을 수 있습니다. 목록으로 돌아가시겠습니까?")) {
- router.push("/admin/report");
- }
+ const handleBackConfirm = () => {
+ setShowBackConfirm(false);
+ router.push("/admin/report");
};
const handleSaveAsTemplate = async (data: {
@@ -193,7 +203,7 @@ export function ReportDesignerToolbar() {
<>
-
+
+ {/* 삭제 확인 모달 */}
+
!open && setDeleteTarget(null)}>
+
+
+ 템플릿 삭제
+
+ "{deleteTarget?.name}" 템플릿을 삭제하시겠습니까?
+
+ 삭제된 템플릿은 복구할 수 없습니다.
+
+
+
+ 취소
+
+ 삭제
+
+
+
+
);
}