picoclaw/web/frontend/src/routes/agent.tsx

23 lines
393 B
TypeScript
Raw Normal View History

import {
Navigate,
Outlet,
createFileRoute,
useRouterState,
} from "@tanstack/react-router"
export const Route = createFileRoute("/agent")({
component: AgentLayout,
})
function AgentLayout() {
const pathname = useRouterState({
select: (state) => state.location.pathname,
})
if (pathname === "/agent") {
return <Navigate to="/agent/hub" />
}
return <Outlet />
}