import { useCopyTimeout } from '@vegaprotocol/react-helpers'; import { TradingButton as Button, VegaIcon, VegaIconNames, } from '@vegaprotocol/ui-toolkit'; import { truncateByChars } from '@vegaprotocol/utils'; import { useVegaWallet, type PubKey } from '@vegaprotocol/wallet'; import { useCallback, useMemo } from 'react'; import CopyToClipboard from 'react-copy-to-clipboard'; import { ViewType, useSidebar } from '../sidebar'; import { useGetCurrentRouteId } from '../../lib/hooks/use-get-current-route-id'; import { useT } from '../../lib/use-t'; export const VegaWalletMenu = ({ setMenu, }: { setMenu: (open: 'nav' | 'wallet' | null) => void; }) => { const t = useT(); const { pubKey, pubKeys, selectPubKey, disconnect } = useVegaWallet(); const currentRouteId = useGetCurrentRouteId(); const setViews = useSidebar((store) => store.setViews); const activeKey = useMemo(() => { return pubKeys?.find((pk) => pk.publicKey === pubKey); }, [pubKey, pubKeys]); const onSelectItem = useCallback( (pubkey: string) => { selectPubKey(pubkey); }, [selectPubKey] ); return (