import { Route, Routes, useParams } from 'react-router-dom'; import { MarketState } from '@vegaprotocol/types'; import { useMarket } from '@vegaprotocol/markets'; import { VegaIconNames } from '@vegaprotocol/ui-toolkit'; import { SidebarButton, SidebarDivider, ViewType, } from '../../components/sidebar'; import { useGetCurrentRouteId } from '../../lib/hooks/use-get-current-route-id'; import { useT } from '../../lib/use-t'; export const MarketsSidebar = () => { const t = useT(); const { marketId } = useParams(); const currentRouteId = useGetCurrentRouteId(); const { data } = useMarket(marketId); const active = data && [MarketState.STATE_ACTIVE, MarketState.STATE_PENDING].includes(data.state); return ( <> {active && ( )} } /> ); };