From 44b74ff4170090673b6eeacd8c528e0abf47b7aa Mon Sep 17 00:00:00 2001 From: joonhoekim <26rote@gmail.com> Date: Mon, 1 Dec 2025 19:52:06 +0900 Subject: (김준회) deprecated code 정리 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../vendor-contact/vendor-contact-table.tsx | 89 ---------------------- 1 file changed, 89 deletions(-) delete mode 100644 lib/rfqs/tbe-table/vendor-contact/vendor-contact-table.tsx (limited to 'lib/rfqs/tbe-table/vendor-contact/vendor-contact-table.tsx') diff --git a/lib/rfqs/tbe-table/vendor-contact/vendor-contact-table.tsx b/lib/rfqs/tbe-table/vendor-contact/vendor-contact-table.tsx deleted file mode 100644 index c079da02..00000000 --- a/lib/rfqs/tbe-table/vendor-contact/vendor-contact-table.tsx +++ /dev/null @@ -1,89 +0,0 @@ -'use client' - -import * as React from "react" -import { ClientDataTable } from "@/components/client-data-table/data-table" -import { getColumns } from "./vendor-contact-table-column" -import { DataTableAdvancedFilterField } from "@/types/table" -import { Loader2 } from "lucide-react" -import { useToast } from "@/hooks/use-toast" -import { getVendorContactsByVendorId } from "../../service" - -export interface VendorData { - id: number - contactName: string - contactPosition: string | null - contactEmail: string - contactPhone: string | null - isPrimary: boolean | null - createdAt: Date - updatedAt: Date -} - -interface VendorContactsTableProps { - vendorId: number -} - -export function VendorContactsTable({ vendorId }: VendorContactsTableProps) { - const { toast } = useToast() - - const columns = React.useMemo( - () => getColumns(), - [] - ) - - const [vendorContacts, setVendorContacts] = React.useState([]) - const [isLoading, setIsLoading] = React.useState(false) - - React.useEffect(() => { - async function loadVendorContacts() { - setIsLoading(true) - try { - const result = await getVendorContactsByVendorId(vendorId) - if (result.success && result.data) { - // undefined 체크 추가 및 타입 캐스팅 - setVendorContacts(result.data as VendorData[]) - } else { - throw new Error(result.error || "Unknown error occurred") - } - } catch (error) { - console.error("협력업체 연락처 로드 오류:", error) - toast({ - title: "Error", - description: "Failed to load vendor contacts", - variant: "destructive", - }) - } finally { - setIsLoading(false) - } - } - loadVendorContacts() - }, [toast, vendorId]) - - const advancedFilterFields: DataTableAdvancedFilterField[] = [ - { id: "contactName", label: "Contact Name", type: "text" }, - { id: "contactPosition", label: "Posiotion", type: "text" }, - { id: "contactEmail", label: "Email", type: "text" }, - { id: "contactPhone", label: "Phone", type: "text" }, - - - ] - - // If loading, show a flex container that fills the parent and centers the spinner - if (isLoading) { - return ( -
- -
- ) - } - - // Otherwise, show the table - return ( - - - ) -} \ No newline at end of file -- cgit v1.2.3