From 59b5715ebb3e1fd7bd4eb02ce50399715734f865 Mon Sep 17 00:00:00 2001
From: 0-Zz-ang <s1998319@gmail.com>
Date: Mon, 4 Aug 2025 14:59:15 +0900
Subject: (박서영) docu-list-rule detail sheet 컴포넌트 추가 및 검색 필터 기능
 오류 수정
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../table/combo-box-settings-table.tsx             | 23 +++++-----------------
 1 file changed, 5 insertions(+), 18 deletions(-)

(limited to 'lib/docu-list-rule/combo-box-settings/table/combo-box-settings-table.tsx')

diff --git a/lib/docu-list-rule/combo-box-settings/table/combo-box-settings-table.tsx b/lib/docu-list-rule/combo-box-settings/table/combo-box-settings-table.tsx
index f6216363..42ce1a19 100644
--- a/lib/docu-list-rule/combo-box-settings/table/combo-box-settings-table.tsx
+++ b/lib/docu-list-rule/combo-box-settings/table/combo-box-settings-table.tsx
@@ -1,15 +1,12 @@
 "use client"
 
 import * as React from "react"
-import { useRouter } from "next/navigation"
 import { useDataTable } from "@/hooks/use-data-table"
 import { DataTable } from "@/components/data-table/data-table"
 import { DataTableAdvancedToolbar } from "@/components/data-table/data-table-advanced-toolbar"
 import type { DataTableAdvancedFilterField } from "@/types/table"
-import { getComboBoxCodeGroups } from "../service"
 import { getColumns } from "./combo-box-settings-table-columns"
 import { ComboBoxOptionsDetailSheet } from "./combo-box-options-detail-sheet"
-import { ComboBoxSettingsTableToolbarActions } from "./combo-box-settings-table-toolbar"
 import { codeGroups } from "@/db/schema/docu-list-rule"
 
 interface ComboBoxSettingsTableProps {
@@ -17,21 +14,15 @@ interface ComboBoxSettingsTableProps {
 }
 
 export function ComboBoxSettingsTable({ promises }: ComboBoxSettingsTableProps) {
-  const router = useRouter()
+
   const rawData = React.use(promises!)
   const [isDetailSheetOpen, setIsDetailSheetOpen] = React.useState(false)
   const [selectedCodeGroup, setSelectedCodeGroup] = React.useState<typeof codeGroups.$inferSelect | null>(null)
-
-  const refreshData = React.useCallback(() => {
-    // 전체 페이지 새로고침 대신 router.refresh() 사용 (성능 개선)
-    router.refresh()
-  }, [router])
-
   // Detail 버튼 클릭 핸들러
-  const handleDetail = (codeGroup: typeof codeGroups.$inferSelect) => {
+  const handleDetail = React.useCallback((codeGroup: typeof codeGroups.$inferSelect) => {
     setSelectedCodeGroup(codeGroup)
     setIsDetailSheetOpen(true)
-  }
+  }, [])
 
   const columns = React.useMemo(() => getColumns({ onDetail: handleDetail }), [handleDetail])
 
@@ -44,8 +35,6 @@ export function ComboBoxSettingsTable({ promises }: ComboBoxSettingsTableProps)
       id: "controlType", label: "Control Type", type: "select", options: [
         { label: "Textbox", value: "textbox" },
         { label: "Combobox", value: "combobox" },
-        { label: "Date", value: "date" },
-        { label: "Number", value: "number" },
       ]
     },
     {
@@ -58,14 +47,12 @@ export function ComboBoxSettingsTable({ promises }: ComboBoxSettingsTableProps)
   ]
 
   const { table } = useDataTable({
-    data: rawData[0].data as any,
+    data: rawData[0].data as typeof codeGroups.$inferSelect[],
     columns,
     pageCount: rawData[0].pageCount,
     enablePinning: true,
     enableAdvancedFilter: true,
-    manualSorting: false,
     initialState: {
-      sorting: [{ id: "createdAt", desc: true }],
       columnPinning: { right: ["actions"] },
       columnFilters: [
         {
@@ -86,7 +73,7 @@ export function ComboBoxSettingsTable({ promises }: ComboBoxSettingsTableProps)
           table={table}
           filterFields={advancedFilterFields}
         >
-          <ComboBoxSettingsTableToolbarActions table={table} onSuccess={refreshData} />
+        
         </DataTableAdvancedToolbar>
       </DataTable>
 
-- 
cgit v1.2.3

