diff options
| author | rlaks5757 <rlaks5757@gmail.com> | 2025-03-28 12:23:10 +0900 |
|---|---|---|
| committer | rlaks5757 <rlaks5757@gmail.com> | 2025-03-28 12:23:10 +0900 |
| commit | fb156d213c8ed42cc8240fbad883e69d85178413 (patch) | |
| tree | 8b376b5579ce7b5bc055d90d644a37295eb4c626 /lib/poa/table/poa-table.tsx | |
| parent | 7c9bd85e1c3d9aa4c2618f33e25936e9cea779fd (diff) | |
Revert "Merge branch 'dev' into feature/kiman"
This reverts commit 7a477a0a5675902714579f5441129436eb61b942, reversing
changes made to 5521051fa5524dc41f902bf2d990a236d6c471c0.
Diffstat (limited to 'lib/poa/table/poa-table.tsx')
| -rw-r--r-- | lib/poa/table/poa-table.tsx | 189 |
1 files changed, 0 insertions, 189 deletions
diff --git a/lib/poa/table/poa-table.tsx b/lib/poa/table/poa-table.tsx deleted file mode 100644 index a5cad02a..00000000 --- a/lib/poa/table/poa-table.tsx +++ /dev/null @@ -1,189 +0,0 @@ -"use client" - -import * as React from "react" -import type { - DataTableAdvancedFilterField, - DataTableFilterField, - DataTableRowAction, -} from "@/types/table" - -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 { getChangeOrders } from "../service" -import { POADetail } from "@/db/schema/contract" -import { getColumns } from "./poa-table-columns" -import { PoaTableToolbarActions } from "./poa-table-toolbar-actions" - -interface ItemsTableProps { - promises: Promise< - [ - Awaited<ReturnType<typeof getChangeOrders>>, - ] - > -} - -export function ChangeOrderListsTable({ promises }: ItemsTableProps) { - const [result] = React.use(promises) - const { data, pageCount } = result - - const [rowAction, setRowAction] = - React.useState<DataTableRowAction<POADetail> | null>(null) - - // Handle row actions - React.useEffect(() => { - if (!rowAction) return - - if (rowAction.type === "items") { - // Handle items view action - setRowAction(null) - } - }, [rowAction]) - - const columns = React.useMemo( - () => getColumns({ setRowAction }), - [setRowAction] - ) - - const filterFields: DataTableFilterField<POADetail>[] = [ - { - id: "contractNo", - label: "계약번호", - }, - { - id: "originalContractName", - label: "계약명", - }, - { - id: "approvalStatus", - label: "승인 상태", - }, - ] - - const advancedFilterFields: DataTableAdvancedFilterField<POADetail>[] = [ - { - id: "contractNo", - label: "계약번호", - type: "text", - }, - { - id: "originalContractName", - label: "계약명", - type: "text", - }, - { - id: "projectId", - label: "프로젝트 ID", - type: "number", - }, - { - id: "vendorId", - label: "벤더 ID", - type: "number", - }, - { - id: "originalStatus", - label: "상태", - type: "text", - }, - { - id: "deliveryTerms", - label: "납품조건", - type: "text", - }, - { - id: "deliveryDate", - label: "납품기한", - type: "date", - }, - { - id: "deliveryLocation", - label: "납품장소", - type: "text", - }, - { - id: "currency", - label: "통화", - type: "text", - }, - { - id: "totalAmount", - label: "총 금액", - type: "number", - }, - { - id: "discount", - label: "할인", - type: "number", - }, - { - id: "tax", - label: "세금", - type: "number", - }, - { - id: "shippingFee", - label: "배송비", - type: "number", - }, - { - id: "netTotal", - label: "최종 금액", - type: "number", - }, - { - id: "changeReason", - label: "변경 사유", - type: "text", - }, - { - id: "approvalStatus", - label: "승인 상태", - type: "text", - }, - { - id: "createdAt", - label: "생성일", - type: "date", - }, - { - id: "updatedAt", - label: "수정일", - type: "date", - }, - ] - - const { table } = useDataTable({ - data, - columns, - pageCount, - filterFields, - enablePinning: true, - enableAdvancedFilter: true, - initialState: { - sorting: [{ id: "createdAt", desc: true }], - columnPinning: { right: ["actions"] }, - }, - getRowId: (originalRow) => String(originalRow.id), - shallow: false, - clearOnDefault: true, - }) - - return ( - <> - <DataTable - table={table} - className="h-[calc(100vh-12rem)]" - > - <DataTableAdvancedToolbar - table={table} - filterFields={advancedFilterFields} - shallow={false} - > - <PoaTableToolbarActions table={table} /> - </DataTableAdvancedToolbar> - </DataTable> - </> - ) -}
\ No newline at end of file |
