import { memo, PropsWithChildren } from 'react'; import { createPortal } from 'react-dom'; import { Link, useLocation } from 'react-router-dom'; import { Drawer, DrawerBody, DrawerCloseButton, DrawerContent, DrawerHeader, DrawerOverlay, useDisclosure, } from '@chakra-ui/react'; import { useFullscreen } from '@mantine/hooks'; import { IoArrowUp } from '@react-icons/all-files/io5/IoArrowUp'; import { IoContract } from '@react-icons/all-files/io5/IoContract'; import { IoExpand } from '@react-icons/all-files/io5/IoExpand'; import { IoLockClosedOutline } from '@react-icons/all-files/io5/IoLockClosedOutline'; import { IoSwapVertical } from '@react-icons/all-files/io5/IoSwapVertical'; import { isLocalhost } from '../../../externals'; import { navigatorConstants } from '../../../viewerConfig'; import { useElectronEvent } from '../../hooks/useElectronEvent'; import useInfo from '../../hooks-query/useInfo'; import { useClientStore } from '../../stores/clientStore'; import { useViewOptionsStore } from '../../stores/viewOptions'; import { isKeyEnter } from '../../utils/keyEvent'; import { handleLinks, linkToOtherHost, openLink } from '../../utils/linkUtils'; import { cx } from '../../utils/styleUtils'; import { RenameClientModal } from '../client-modal/RenameClientModal'; import CopyTag from '../copy-tag/CopyTag'; import style from './NavigationMenu.module.scss'; interface NavigationMenuProps { isOpen: boolean; onClose: () => void; } function NavigationMenu(props: NavigationMenuProps) { const { isOpen, onClose } = props; const id = useClientStore((store) => store.id); const name = useClientStore((store) => store.name); const { isOpen: isOpenRename, onOpen: onRenameOpen, onClose: onCloseRename } = useDisclosure(); const { fullscreen, toggle } = useFullscreen(); const { mirror, toggleMirror } = useViewOptionsStore(); const location = useLocation(); return createPortal(
, document.body, ); } interface OtherAddressesProps { currentLocation: string; } function OtherAddresses(props: OtherAddressesProps) { const { currentLocation } = props; const { data } = useInfo(); // there is no point showing this if we only have one interface if (data.networkInterfaces.length < 2) { return null; } return (