From e9897d416b3e7327bbd4d4aef887eee37751ae82 Mon Sep 17 00:00:00 2001
From: dujinkim <dujin.kim@dtsolution.co.kr>
Date: Fri, 27 Jun 2025 01:16:20 +0000
Subject: (대표님) 20250627 오전 10시 작업사항
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 lib/evaluation/table/evaluation-table.tsx | 24 +++++++++++-------------
 1 file changed, 11 insertions(+), 13 deletions(-)

(limited to 'lib/evaluation/table/evaluation-table.tsx')

diff --git a/lib/evaluation/table/evaluation-table.tsx b/lib/evaluation/table/evaluation-table.tsx
index a628475d..9e32debb 100644
--- a/lib/evaluation/table/evaluation-table.tsx
+++ b/lib/evaluation/table/evaluation-table.tsx
@@ -23,7 +23,8 @@ import { useMemo } from "react"
 import { PeriodicEvaluationFilterSheet } from "./evaluation-filter-sheet"
 import { getPeriodicEvaluationsColumns } from "./evaluation-columns"
 import { PeriodicEvaluationView } from "@/db/schema"
-import { getPeriodicEvaluations } from "../service"
+import { getPeriodicEvaluations, getPeriodicEvaluationsStats } from "../service"
+import { PeriodicEvaluationsTableToolbarActions } from "./periodic-evaluations-toolbar-actions"
 
 interface PeriodicEvaluationsTableProps {
   promises: Promise<[Awaited<ReturnType<typeof getPeriodicEvaluations>>]>
@@ -44,17 +45,9 @@ function PeriodicEvaluationsStats({ evaluationYear }: { evaluationYear: number }
       try {
         setIsLoading(true)
         setError(null)
-        // TODO: getPeriodicEvaluationsStats 구현 필요
-        const statsData = {
-          total: 150,
-          pendingSubmission: 25,
-          submitted: 45,
-          inReview: 30,
-          reviewCompleted: 35,
-          finalized: 15,
-          averageScore: 82.5,
-          completionRate: 75
-        }
+
+        // 실제 통계 함수 호출
+        const statsData = await getPeriodicEvaluationsStats(evaluationYear)
 
         if (isMounted) {
           setStats(statsData)
@@ -76,7 +69,7 @@ function PeriodicEvaluationsStats({ evaluationYear }: { evaluationYear: number }
     return () => {
       isMounted = false
     }
-  }, [])
+  }, [evaluationYear]) // evaluationYear 의존성 추가
 
   if (isLoading) {
     return (
@@ -230,6 +223,8 @@ export function PeriodicEvaluationsTable({ promises, evaluationYear, className }
   const [promiseData] = React.use(promises)
   const tableData = promiseData
 
+  console.log(tableData)
+
   const getSearchParam = React.useCallback((key: string, defaultValue?: string): string => {
     return searchParams?.get(key) ?? defaultValue ?? "";
   }, [searchParams]);
@@ -453,6 +448,9 @@ export function PeriodicEvaluationsTable({ promises, evaluationYear, className }
                         onRenamePreset={renamePreset}
                       />
 
+                      <PeriodicEvaluationsTableToolbarActions
+                        table={table}
+                      />
                       {/* TODO: PeriodicEvaluationsTableToolbarActions 구현 */}
                     </div>
                   </DataTableAdvancedToolbar>
-- 
cgit v1.2.3

