summaryrefslogtreecommitdiff
path: root/lib/vendor-rfq-response/vendor-cbe-table/rfq-items-table/rfq-items-table-column.tsx
blob: bf4ae709aadcdd1037fec47c00f73009be5344c8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
"use client"
// Because columns rely on React state/hooks for row actions

import * as React from "react"
import { ColumnDef, Row } from "@tanstack/react-table"
import { ClientDataTableColumnHeaderSimple } from "@/components/client-data-table/data-table-column-simple-header"
import { formatDate } from "@/lib/utils"
import { Checkbox } from "@/components/ui/checkbox"
import { ItemData } from "./rfq-items-table"


/** getColumns: return array of ColumnDef for 'vendors' data */
export function getColumns(): ColumnDef<ItemData>[] {
  return [
    
    // Vendor Name
    {
      accessorKey: "itemCode",
      header: ({ column }) => (
        <ClientDataTableColumnHeaderSimple column={column} title="Item Code" />
      ),
      cell: ({ row }) => row.getValue("itemCode"),
    },
    
    // Vendor Code
    {
      accessorKey: "description",
      header: ({ column }) => (
        <ClientDataTableColumnHeaderSimple column={column} title="Description" />
      ),
      cell: ({ row }) => row.getValue("description"),
    },
    
    // Status
    {
      accessorKey: "quantity",
      header: ({ column }) => (
        <ClientDataTableColumnHeaderSimple column={column} title="Quantity" />
      ),
      cell: ({ row }) => row.getValue("quantity"),
    },
    

    // Created At
    {
      accessorKey: "createdAt",
      header: ({ column }) => (
        <ClientDataTableColumnHeaderSimple column={column} title="Created At" />
      ),
      cell: ({ cell }) => formatDate(cell.getValue() as Date),
    },
    
    // Updated At
    {
      accessorKey: "updatedAt",
      header: ({ column }) => (
        <ClientDataTableColumnHeaderSimple column={column} title="Updated At" />
      ),
      cell: ({ cell }) => formatDate(cell.getValue() as Date),
    },
  ]
}