feat(l1): register /l1/* routes + L1RouteGuard + page stubs
L1RouteGuard wraps the new routes and redirects users without canUseL1Surface back to /. Page components are stubs in this task (real UI in T21-T24): L1Dashboard, L1WalkPage, L1DraftsPage, L1TicketsPage. Routes: /l1, /l1/walk/:sessionId, /l1/drafts, /l1/tickets — all gated. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
10
frontend/src/components/layout/L1RouteGuard.tsx
Normal file
10
frontend/src/components/layout/L1RouteGuard.tsx
Normal file
@@ -0,0 +1,10 @@
|
||||
import { Navigate } from 'react-router-dom'
|
||||
import { usePermissions } from '@/hooks/usePermissions'
|
||||
|
||||
export function L1RouteGuard({ children }: { children: React.ReactNode }) {
|
||||
const { canUseL1Surface } = usePermissions()
|
||||
if (!canUseL1Surface) {
|
||||
return <Navigate to="/" replace />
|
||||
}
|
||||
return <>{children}</>
|
||||
}
|
||||
Reference in New Issue
Block a user