'use client'; import { BiAnalyse, BiDiamond, BiDownload, BiDuplicate, BiMenu, BiMeteor, BiPlusCircle, BiShareAlt, BiTrash, BiUpload } from 'react-icons/bi'; import { FiEdit } from 'react-icons/fi'; import { LuCrown, LuGlasses } from 'react-icons/lu'; import Button from '@/components/Common/Button'; import Dropdown from '@/components/Common/Dropdown'; import DropdownButton from '@/components/Common/DropdownButton'; import { useAccessMode } from '@/context/AccessModeContext'; import { useAuth } from '@/context/AuthContext'; import { useConceptNavigation } from '@/context/NavigationContext'; import { useRSForm } from '@/context/RSFormContext'; import useDropdown from '@/hooks/useDropdown'; import { UserAccessMode } from '@/models/miscellaneous'; import { describeAccessMode, labelAccessMode } from '@/utils/labels'; interface RSTabsMenuProps { isMutable: boolean showUploadDialog: () => void showCloneDialog: () => void onDestroy: () => void onClaim: () => void onShare: () => void onDownload: () => void onReindex: () => void onTemplates: () => void } function RSTabsMenu({ isMutable, showUploadDialog, showCloneDialog, onDestroy, onShare, onDownload, onClaim, onReindex, onTemplates }: RSTabsMenuProps) { const router = useConceptNavigation(); const { user } = useAuth(); const { isOwned, isClaimable } = useRSForm(); const { mode, setMode } = useAccessMode(); const schemaMenu = useDropdown(); const editMenu = useDropdown(); const accessMenu = useDropdown(); function handleClaimOwner() { editMenu.hide(); onClaim(); } function handleDelete() { schemaMenu.hide(); onDestroy(); } function handleDownload () { schemaMenu.hide(); onDownload(); } function handleUpload() { schemaMenu.hide(); showUploadDialog(); } function handleClone() { schemaMenu.hide(); showCloneDialog(); } function handleShare() { schemaMenu.hide(); onShare(); } function handleReindex() { editMenu.hide(); onReindex(); } function handleTemplates() { editMenu.hide(); onTemplates(); } function handleChangeMode(newMode: UserAccessMode) { accessMenu.hide(); setMode(newMode); } function handleCreateNew() { router.push('/library/create'); } return (