diff --git a/src/pages/transaction/approval-transaction/hooks/ApprovalTransactionContext.tsx b/src/pages/transaction/approval-transaction/hooks/ApprovalTransactionContext.tsx index 39b0d25..c8de0fa 100644 --- a/src/pages/transaction/approval-transaction/hooks/ApprovalTransactionContext.tsx +++ b/src/pages/transaction/approval-transaction/hooks/ApprovalTransactionContext.tsx @@ -95,22 +95,27 @@ const ApprovalTransactionProvider = ({ children }: { children: React.ReactNode } }, { accessorKey: 'origin_customer.fullname', - header: ({ column }) => , + header: ({ column }) => ( + + ), enableSorting: false, enableHiding: false, meta: { - headerClassName: 'w-[250px]', + headerClassName: 'w-[250px]' }, + cell: ({ row }) => row.original.origin_customer?.fullname ?? '' }, { accessorFn: (row) => { - const purchase = row?.purchase?.destination_customer.fullname; - const transfer = row?.transfer?.destination_customer.fullname; + const purchase = row?.purchase?.destination_customer?.fullname; + const transfer = row?.transfer?.destination_customer?.fullname; - return purchase ?? transfer ?? "-"; + return purchase ?? transfer ?? ""; }, id: 'destination_customer.fullname', - header: ({ column }) => , + header: ({ column }) => ( + + ), enableSorting: false, enableHiding: false, meta: { diff --git a/src/pages/transaction/history-transaction/hooks/TransactionContext.tsx b/src/pages/transaction/history-transaction/hooks/TransactionContext.tsx index fbbd9ed..760eec7 100644 --- a/src/pages/transaction/history-transaction/hooks/TransactionContext.tsx +++ b/src/pages/transaction/history-transaction/hooks/TransactionContext.tsx @@ -113,22 +113,27 @@ const TransactionProvider = ({ children }: { children: React.ReactNode }) => { }, { accessorKey: 'origin_customer.fullname', - header: ({ column }) => , + header: ({ column }) => ( + + ), enableSorting: false, enableHiding: false, meta: { headerClassName: 'w-[250px]' - } + }, + cell: ({ row }) => row.original.origin_customer?.fullname ?? '' }, { accessorFn: (row) => { - const purchase = row?.purchase?.destination_customer.fullname; - const transfer = row?.transfer?.destination_customer.fullname; + const purchase = row?.purchase?.destination_customer?.fullname; + const transfer = row?.transfer?.destination_customer?.fullname; - return purchase ?? transfer ?? "-"; + return purchase ?? transfer ?? ""; }, id: 'destination_customer.fullname', - header: ({ column }) => , + header: ({ column }) => ( + + ), enableSorting: false, enableHiding: false, meta: { @@ -228,7 +233,7 @@ const TransactionProvider = ({ children }: { children: React.ReactNode }) => { enableSorting: false, enableHiding: false, cell: (data) => { - const row = data.row.original; + const row = data.row.original; const isVisible = (row.status === 'F' ? true : false || row.status === 'P' ? true : false) && row.status_approve !== 'W' ? true : false; return (