From 07819844d5ef7e323fd956eacfedecb2f4f4bb80 Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Fri, 17 Nov 2023 15:16:23 +0700 Subject: Update result feature --- src/modules/result/components/DetailRow.tsx | 38 ++++++++++++++++++----------- 1 file changed, 24 insertions(+), 14 deletions(-) (limited to 'src/modules/result/components/DetailRow.tsx') diff --git a/src/modules/result/components/DetailRow.tsx b/src/modules/result/components/DetailRow.tsx index 99ccb01..29cf984 100644 --- a/src/modules/result/components/DetailRow.tsx +++ b/src/modules/result/components/DetailRow.tsx @@ -7,6 +7,7 @@ import styles from './table.module.css' import { CornerDownRightIcon } from 'lucide-react'; import { User } from '@prisma/client'; import clsxm from '@/common/libs/clsxm'; +import getClientCredential from '@/common/libs/getClientCredential'; const DetailRow = ({ productId }: { productId: number }) => { const { filter } = useResultStore() @@ -26,7 +27,7 @@ const DetailRow = ({ productId }: { productId: number }) => { if (detailLocation.isLoading) { return ( - +
@@ -53,6 +54,9 @@ const DetailRow = ({ productId }: { productId: number }) => { + + + @@ -64,18 +68,24 @@ const DetailRow = ({ productId }: { productId: number }) => { ) } -const QuantityColumn = ({ data }: { data: { quantity?: number | undefined, user?: User } }) => ( -
- {typeof data?.quantity !== 'number' && '-'} - {data.quantity !== null && ( - <> - {data.quantity} -
- {data.user?.name} -
- - )} -
-) +const QuantityColumn = ({ data }: { data: { quantity?: number | undefined, user?: User } }) => { + const credential = getClientCredential() + + if (!(credential?.team == "VERIFICATION")) return '-' + + return ( +
+ {typeof data?.quantity !== 'number' && '-'} + {data.quantity !== null && ( + <> + {data.quantity} +
+ {data.user?.name} +
+ + )} +
+ ) +} export default DetailRow \ No newline at end of file -- cgit v1.2.3