import clsx from 'clsx'; import { useNewNavigate } from '@/modules'; const serverList = ['container', 'map']; const serverPath = [ { path: 'container', links: ['edit/list', 'preview/:id', 'edit/:id'], }, { path: 'app', links: ['edit/list', ':app/version/list'], }, { path: 'file', links: ['edit/list'], }, { path: 'map', links: ['/'], }, { path: 'org', links: ['edit/list'], }, ]; const ServerPath = () => { const navigate = useNewNavigate(); return (

Site Map

{serverPath.map((item) => { const links = item.links.map((link) => { const hasId = link.includes(':'); const _path = link === '/' ? item.path : item.path + '/' + link; return (
{ if (hasId) { return; } console.log('link', link); if (link === '/') { navigate(`/${item.path}`); return; } if (link) { navigate(`/${item.path}/${link}`); } else { navigate(`/${item.path}`); } }}>
{_path}
); }); return (
{links}
); })}
); }; export const App = ServerPath; export const ServerList = () => { return (
{serverList.map((item) => { return (
{item}
); })}
); };