import { useParams } from '@tanstack/react-router'; import { PAGES } from './registry'; import { useSettingsStore } from '@/store/settings-store'; import type { Section } from '@/types'; /** The page of the current route (#/{page}). */ export default function PageView() { const { page } = useParams( { from: '/$page' } ); const section = useSettingsStore( ( state ) => state.sections[ page ] ); const definition = PAGES[ page ]; if ( ! section || ! definition ) { return null; } const Page = definition.component; return } title={ definition.title() } />; }