import { lazy, Suspense } from 'react'
import { Navigate, Route, Routes, useParams } from 'react-router-dom'
import { getToken } from './api/client'
import { readLane } from './lib/lane'
import Login from './pages/Login'
import ModuleSelect from './pages/ModuleSelect'
import WebLayout from './components/WebLayout'
const Docs = lazy(() => import('./pages/Docs'))
const Switches = lazy(() => import('./pages/Switches'))
const Events = lazy(() => import('./pages/Events'))
const Orders = lazy(() => import('./pages/Orders'))
const Users = lazy(() => import('./pages/Users'))
const Ntfy = lazy(() => import('./pages/Ntfy'))
const Social = lazy(() => import('./pages/Social'))
const SocialDetail = lazy(() => import('./pages/SocialDetail'))
const Blog = lazy(() => import('./pages/Blog'))
const Operations = lazy(() => import('./pages/Operations'))
import LaneHub, { type LaneKey } from './pages/LaneHub'
/**
* admin.nomadro.com — 游民社区运营台
* 登录 → /{lane}/social/overview(社区优先)
*/
function Private({ children }: { children: React.ReactNode }) {
if (!getToken()) return
return <>{children}>
}
function LaneGuard({ children }: { children: React.ReactNode }) {
const { lane } = useParams()
if (lane !== 'cn' && lane !== 'intl') return
return <>{children}>
}
function LaneHome() {
const { lane } = useParams()
return
}
function HomeRedirect() {
const lane = readLane()
return
}
export default function App() {
return (
正在加载工作区…}>
} />
}
/>
}
/>
}
>
} />
} />
} />
} />
} />
} />
} />
} />
} />
} />
} />
} />
} />
} />
} />
} />
} />
} />
} />
} />
} />
} />
} />
} />
} />
} />
} />
} />
} />
} />
} />
} />
} />
} />
} />
} />
} />
} />
} />
} />
} />
} />
} />
} />
} />
} />
} />
} />
} />
} />
} />
} />
} />
)
}