d15a13e485
- Delete all ops page components (ReviewQueue, AIMonitoring, Governance, SourceMonitoring, ActivityTimeline, SignalPipeline) - Remove OPERATIONS workspace from AppShell config, nav order, path detection - Remove all /ops/* routes from App.tsx - Remove WorkspaceType.OPERATIONS from allowedWorkspaces in authService, sessionStore, permissions - Keep MarketIntelligence page (already moved to /supply/market-intelligence) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
20 lines
516 B
TypeScript
20 lines
516 B
TypeScript
import type { ReactNode } from 'react'
|
|
import type { MockUser } from '../../stores/sessionStore'
|
|
import { useSessionStore } from '../../stores/sessionStore'
|
|
|
|
interface PermissionGateProps {
|
|
check: (user: MockUser) => boolean
|
|
fallback?: ReactNode
|
|
children: ReactNode
|
|
}
|
|
|
|
export function PermissionGate({ check, fallback = null, children }: PermissionGateProps) {
|
|
const { currentUser } = useSessionStore()
|
|
|
|
if (!currentUser || !check(currentUser)) {
|
|
return <>{fallback}</>
|
|
}
|
|
|
|
return <>{children}</>
|
|
}
|