From 44bdb81a60d3a44ba7e379f3c20fe6d8fb284339 Mon Sep 17 00:00:00 2001
From: dujinkim <dujin.kim@dtsolution.co.kr>
Date: Mon, 7 Jul 2025 08:24:16 +0000
Subject: (대표님) 변경사항 20250707 12시 30분
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../table/login-sessions-table-toolbar-actions.tsx | 26 +++++++++++++++++-----
 1 file changed, 21 insertions(+), 5 deletions(-)

(limited to 'lib/login-session/table/login-sessions-table-toolbar-actions.tsx')

diff --git a/lib/login-session/table/login-sessions-table-toolbar-actions.tsx b/lib/login-session/table/login-sessions-table-toolbar-actions.tsx
index 36665bc0..2c8781a3 100644
--- a/lib/login-session/table/login-sessions-table-toolbar-actions.tsx
+++ b/lib/login-session/table/login-sessions-table-toolbar-actions.tsx
@@ -8,6 +8,8 @@ import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip
 
 import { ExtendedLoginSession } from "../validation"
 import { exportTableToExcel } from "@/lib/export_all"
+import { useTransition } from "react"
+import { useRouter } from "next/navigation"
 
 interface LoginSessionsTableToolbarActionsProps {
   table: Table<ExtendedLoginSession>
@@ -16,6 +18,15 @@ interface LoginSessionsTableToolbarActionsProps {
 export function LoginSessionsTableToolbarActions({
   table,
 }: LoginSessionsTableToolbarActionsProps) {
+
+  const router = useRouter()
+  const [isPending, startTransition] = useTransition()
+
+  const handleRefresh = () => {
+    startTransition(() => {
+      router.refresh() // ✅ 서버 컴포넌트만 새로고침 (더 빠르고 부드러움)
+    })
+  }
   return (
     <div className="flex items-center gap-2">
       <Tooltip>
@@ -44,18 +55,23 @@ export function LoginSessionsTableToolbarActions({
           <Button
             variant="outline"
             size="sm"
-            onClick={() => window.location.reload()}
+            onClick={handleRefresh}
+            disabled={isPending} // 로딩 중 비활성화
           >
-            <RotateCcw className="mr-2 size-4" aria-hidden="true" />
-            새로고침
+            <RotateCcw 
+              className={`mr-2 size-4 ${isPending ? 'animate-spin' : ''}`} 
+              aria-hidden="true" 
+            />
+            {isPending ? '새로고침 중...' : '새로고침'}
           </Button>
         </TooltipTrigger>
         <TooltipContent>
           <p>데이터 새로고침</p>
         </TooltipContent>
       </Tooltip>
+      
 
-      <Tooltip>
+      {/* <Tooltip>
         <TooltipTrigger asChild>
           <Button
             variant="outline"
@@ -72,7 +88,7 @@ export function LoginSessionsTableToolbarActions({
         <TooltipContent>
           <p>보안 분석 리포트 생성</p>
         </TooltipContent>
-      </Tooltip>
+      </Tooltip> */}
     </div>
   )
 }
\ No newline at end of file
-- 
cgit v1.2.3

