import type { ComponentType } from 'react'; import type { PageDocument, PageSearchParams } from '#web-runtime/types'; import BlogPageLayout from './components/BlogPageLayout'; import EditorialPageLayout from './components/EditorialPageLayout'; import StandardPageLayout from './components/StandardPageLayout'; export interface PageLayoutProps { page: PageDocument; searchParams?: PageSearchParams; } type PageLayout = ComponentType; export const PAGE_LAYOUT_REGISTRY: Readonly> = { 'landing': StandardPageLayout, 'blog': BlogPageLayout, 'blog-item': EditorialPageLayout }; export function RegisteredPageLayout({ page, searchParams }: PageLayoutProps) { const Layout = PAGE_LAYOUT_REGISTRY[page.layout] ?? StandardPageLayout; return ; }