import { Suspense } from 'react';
import { useRoutes } from 'react-router-dom';
import dynamic from 'next/dynamic';
import { t } from '@vegaprotocol/react-helpers';
const LazyHome = dynamic(() => import('../client-pages/home'), {
ssr: false,
});
const LazyLiquidity = dynamic(() => import('../client-pages/liquidity'), {
ssr: false,
});
const LazyMarkets = dynamic(() => import('../client-pages/markets'), {
ssr: false,
});
const LazyMarket = dynamic(() => import('../client-pages/market'), {
ssr: false,
});
const LazyPortfolio = dynamic(() => import('../client-pages/portfolio'), {
ssr: false,
});
export enum Routes {
HOME = '/',
MARKETS = '/markets',
PORTFOLIO = '/portfolio',
}
const routerConfig = [
{
index: true,
element: ,
},
{
path: Routes.MARKETS,
element: ,
},
{
path: 'markets/:marketId',
element: ,
},
{
path: 'liquidity/:marketId',
element: ,
},
{
path: Routes.PORTFOLIO,
element: ,
},
];
export const ClientRouter = () => {
const routes = useRoutes(routerConfig);
return (
{t('Loading...')}
}
>
{routes}
);
};