summaryrefslogtreecommitdiff
path: root/src/modules/result/components
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/result/components')
-rw-r--r--src/modules/result/components/MoreMenu.tsx17
-rw-r--r--src/modules/result/components/Table.tsx6
2 files changed, 19 insertions, 4 deletions
diff --git a/src/modules/result/components/MoreMenu.tsx b/src/modules/result/components/MoreMenu.tsx
index 03c9786..cd4e8be 100644
--- a/src/modules/result/components/MoreMenu.tsx
+++ b/src/modules/result/components/MoreMenu.tsx
@@ -1,16 +1,29 @@
"use client";
import { Button, Dropdown, DropdownItem, DropdownMenu, DropdownTrigger, useDisclosure } from '@nextui-org/react'
import { MoreVerticalIcon } from 'lucide-react'
-import React from 'react'
+import React, { useState, useEffect } from 'react'
import ImportModal from './ImportModal';
import ProductModal from './ProductModal';
import getClientCredential from '@/common/libs/getClientCredential';
+type Credential = {
+ team: string;
+};
+
const MoreMenu = () => {
- const credential = getClientCredential()
+ const [credential, setCredential] = useState<Credential | null>(null);
const importModal = useDisclosure();
const productModal = useDisclosure();
+ useEffect(() => {
+ const cred = getClientCredential();
+ setCredential(cred);
+ }, []);
+
+ if (!credential || credential.team !== 'VERIFICATION') {
+ return null;
+ }
+
return credential && credential.team == 'VERIFICATION' && (
<>
<Dropdown>
diff --git a/src/modules/result/components/Table.tsx b/src/modules/result/components/Table.tsx
index 94ed5bf..fc40932 100644
--- a/src/modules/result/components/Table.tsx
+++ b/src/modules/result/components/Table.tsx
@@ -99,7 +99,8 @@ const Table = () => {
<div className="w-full flex-1 overflow-auto pb-4">
<table className="w-full">
- <thead className={styles.thead}>
+ <thead className={styles.thead}>
+ <tr>
<th className={styles.th}>STATUS</th>
<th className={clsxm(styles.th, '!text-left')}>NAMA PRODUK</th>
<th className={styles.th}>TIM HITUNG 1</th>
@@ -109,7 +110,8 @@ const Table = () => {
<th className={styles.th}>ON-HAND QTY</th>
<th className={styles.th}>GUDANG SELISIH</th>
<th className={styles.th}></th>
- </thead>
+ </tr>
+ </thead>
<tbody className={styles.tbody}>
{!isLoading && stockOpnames.data?.result.map((stockOpname: StockOpnameRes['result']) => (
<>