import { useNavigate } from 'react-router-dom'; import Button from '../../components/Common/Button'; import Checkbox from '../../components/Common/Checkbox'; import Dropdown from '../../components/Common/Dropdown'; import DropdownButton from '../../components/Common/DropdownButton'; import { CloneIcon, CrownIcon, DownloadIcon, DumpBinIcon, EyeIcon, EyeOffIcon, MenuIcon, PenIcon, PlusIcon, ShareIcon, UploadIcon } from '../../components/Icons'; import { useAuth } from '../../context/AuthContext'; import { useRSForm } from '../../context/RSFormContext'; import useDropdown from '../../hooks/useDropdown'; interface RSTabsMenuProps { showUploadDialog: () => void showCloneDialog: () => void onDestroy: () => void onClaim: () => void onShare: () => void onDownload: () => void } function RSTabsMenu({ showUploadDialog, showCloneDialog, onDestroy, onShare, onDownload, onClaim }: RSTabsMenuProps) { const navigate = useNavigate(); const { user } = useAuth(); const { isOwned, isEditable, isTracking, isReadonly: readonly, isForceAdmin: forceAdmin, toggleTracking, toggleForceAdmin, toggleReadonly } = useRSForm(); const schemaMenu = useDropdown(); const editMenu = 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 handleCreateNew() { navigate('/rsform-create'); } return (
); } export default RSTabsMenu