import { t } from '@vegaprotocol/i18n'; import { TradingDropdownItem, TradingDropdownCopyItem, Link, VegaIcon, VegaIconNames, ActionsDropdown, } from '@vegaprotocol/ui-toolkit'; import { DApp, EXPLORER_MARKET, useLinks } from '@vegaprotocol/environment'; import { useAssetDetailsDialogStore } from '@vegaprotocol/assets'; import { useNavigate } from 'react-router-dom'; import { Links, Routes } from '../../pages/client-router'; export const MarketActionsDropdown = ({ marketId, assetId, successorMarketID, parentMarketID, }: { marketId: string; assetId: string; successorMarketID: string | null | undefined; parentMarketID: string | null | undefined; }) => { const navigate = useNavigate(); const open = useAssetDetailsDialogStore((store) => store.open); const linkCreator = useLinks(DApp.Explorer); return ( {t('View on Explorer')} { open(assetId, e.target as HTMLElement); }} > {t('View settlement asset details')} {parentMarketID && ( { navigate(Links[Routes.MARKET](parentMarketID)); }} > {t('View parent market')} )} {successorMarketID && ( { navigate(Links[Routes.MARKET](successorMarketID)); }} > {t('View successor market')} )} ); };