"use client"; import * as React from "react"; import { type Table } from "@tanstack/react-table"; // import { Plus } from "lucide-react"; // import { Button } from "@/components/ui/button"; // import { Input } from "@/components/ui/input"; // 주석처리 (Excel 기능 사용 안함) // import { useToast } from "@/hooks/use-toast"; // 주석처리 (Excel 기능 사용 안함) // import { AddPossibleItemDialog } from "./add-possible-item-dialog"; // import { DeletePossibleItemsDialog } from "./delete-possible-items-dialog"; // 새로운 스키마에 맞는 타입 import import type { TechVendorPossibleItemsData } from "../service"; interface PossibleItemsTableToolbarActionsProps { table: Table; } export function PossibleItemsTableToolbarActions({ // table, }: PossibleItemsTableToolbarActionsProps) { // const { toast } = useToast(); // 주석처리 (Excel 기능 사용 안함) // const selectedRows = table.getFilteredSelectedRowModel().rows; // const hasSelection = selectedRows.length > 0; // const selectedItems = selectedRows.map(row => row.original); // const handleSuccess = () => { // table.toggleAllRowsSelected(false); // // 페이지 새로고침이나 데이터 다시 로드 필요 // window.location.reload(); // }; // Excel Export 함수 주석처리 (새 스키마에서 사용하지 않음) // const handleExport = async () => { // try { // const { exportTechVendorPossibleItemsToExcel } = await import("./excel-export"); // const result = await exportTechVendorPossibleItemsToExcel(table.getFilteredRowModel().rows.map(row => row.original)); // // if (result.success) { // toast({ // title: "성공", // description: "Excel 파일이 다운로드되었습니다.", // }); // } else { // toast({ // title: "오류", // description: result.error || "내보내기 중 오류가 발생했습니다.", // variant: "destructive", // }); // } // } catch (error) { // console.error("Export error:", error); // toast({ // title: "오류", // description: "내보내기 중 오류가 발생했습니다.", // variant: "destructive", // }); // } // }; // Excel Import 함수 주석처리 (새 스키마에서 사용하지 않음) // const handleImport = async (event: React.ChangeEvent) => { // const file = event.target.files?.[0]; // if (!file) return; // try { // const { importTechVendorPossibleItemsFromExcel } = await import("./excel-import"); // const result = await importTechVendorPossibleItemsFromExcel(file); // // if (result.success) { // toast({ // title: "성공", // description: `${result.successCount}개의 아이템이 가져와졌습니다.`, // }); // // 페이지 새로고침이나 데이터 다시 로드 필요 // window.location.reload(); // } else { // toast({ // title: "가져오기 완료", // description: `${result.successCount}개 성공, ${result.failedRows.length}개 실패`, // variant: result.successCount > 0 ? "default" : "destructive", // }); // } // } catch (error) { // console.error("Import error:", error); // toast({ // title: "오류", // description: "가져오기 중 오류가 발생했습니다.", // variant: "destructive", // }); // } // // Reset input // event.target.value = ""; // }; // Excel Template 함수 주석처리 (새 스키마에서 사용하지 않음) // const handleDownloadTemplate = async () => { // try { // const { exportTechVendorPossibleItemsTemplate } = await import("./excel-template"); // const result = await exportTechVendorPossibleItemsTemplate(); // if (result.success) { // toast({ // title: "성공", // description: "템플릿 파일이 다운로드되었습니다.", // }); // } else { // toast({ // title: "오류", // description: result.error || "템플릿 다운로드 중 오류가 발생했습니다.", // variant: "destructive", // }); // } // } catch (error) { // console.error("Template download error:", error); // toast({ // title: "오류", // description: "템플릿 다운로드 중 오류가 발생했습니다.", // variant: "destructive", // }); // } // }; return (
{/* {hasSelection && ( */} {/* // // )} // // // {/* Excel 관련 버튼들 주석처리 (새 스키마에서 사용하지 않음) */} {/* */}
); }