diff options
| author | IT Fixcomart <it@fixcomart.co.id> | 2024-07-05 04:40:20 +0000 |
|---|---|---|
| committer | IT Fixcomart <it@fixcomart.co.id> | 2024-07-05 04:40:20 +0000 |
| commit | bb9a14f9dd07c802c9b27be06cc0ba16d220fc78 (patch) | |
| tree | 4ea481a3905bf7a972356be6da1239dd0e2f11a2 /src/modules/result/components/MoreMenu.tsx | |
| parent | a2854778bfba99eb1eded911b48964f076e17a27 (diff) | |
| parent | bb1cd2048fd3f4d93479509a561b35e3b0fa1f2d (diff) | |
Merged in Feature/iman-update (pull request #1)
Feature/iman update
Diffstat (limited to 'src/modules/result/components/MoreMenu.tsx')
| -rw-r--r-- | src/modules/result/components/MoreMenu.tsx | 17 |
1 files changed, 15 insertions, 2 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> |
