From 5b6313f16f508882a0ea67716b7dbaa1c6967f04 Mon Sep 17 00:00:00 2001
From: dujinkim <dujin.kim@dtsolution.co.kr>
Date: Mon, 30 Jun 2025 08:28:13 +0000
Subject: (대표님) 20250630 16시 - 유저 도메인별 라우터 분리와 보안성검토 대응
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 lib/menu-list/table/initialize-button.tsx | 42 +++++++++++++++++++++++++++++++
 1 file changed, 42 insertions(+)
 create mode 100644 lib/menu-list/table/initialize-button.tsx

(limited to 'lib/menu-list/table/initialize-button.tsx')

diff --git a/lib/menu-list/table/initialize-button.tsx b/lib/menu-list/table/initialize-button.tsx
new file mode 100644
index 00000000..1b8a2458
--- /dev/null
+++ b/lib/menu-list/table/initialize-button.tsx
@@ -0,0 +1,42 @@
+// app/evcp/menu-list/components/initialize-button.tsx
+
+"use client";
+
+import { useState } from "react";
+import { Button } from "@/components/ui/button";
+import { RefreshCw } from "lucide-react";
+import { toast } from "sonner";
+import { initializeMenuAssignments } from "../servcie";
+
+export function InitializeButton() {
+  const [isLoading, setIsLoading] = useState(false);
+
+  const handleInitialize = async () => {
+    setIsLoading(true);
+    try {
+      const result = await initializeMenuAssignments();
+      
+      if (result.success) {
+        toast.success(result.message);
+      } else {
+        toast.error(result.message);
+      }
+    } catch (error) {
+      toast.error("메뉴 초기화 중 오류가 발생했습니다.");
+    } finally {
+      setIsLoading(false);
+    }
+  };
+
+  return (
+    <Button 
+      onClick={handleInitialize} 
+      disabled={isLoading}
+      variant="outline"
+      size="sm"
+    >
+      <RefreshCw className={`h-4 w-4 mr-2 ${isLoading ? 'animate-spin' : ''}`} />
+      메뉴 초기화
+    </Button>
+  );
+}
\ No newline at end of file
-- 
cgit v1.2.3

