Files
webb/src/app/page.tsx
T

41 lines
1.2 KiB
TypeScript
Raw Normal View History

import { getPageConfig, getAllTools, getAllApps, getAllCategories, getToolById, getAppById } from '@/lib/config/loader';
import { getEndpointById } from '@/lib/catalog/loader';
import { SectionRenderer } from '@/components/sections/SectionRenderer';
import { notFound } from 'next/navigation';
export const revalidate = 600; // ISR 10 minutes fallback per PRD §4.2
export default function HomePage() {
const page = getPageConfig('home');
if (!page) notFound();
const tools = getAllTools();
const apps = getAllApps();
const categories = getAllCategories();
// Find hero tool and variants
const heroTool = getToolById('face.blemish.remove') || tools[0];
const heroApp = heroTool ? getAppById(heroTool.homeApp) : null;
const endpoint = heroTool?.tryIt?.endpointRef?.id ? getEndpointById(heroTool.tryIt.endpointRef.id) : undefined;
const variants = endpoint?.variants || [];
const context = {
page,
tools,
apps,
categories,
tool: heroTool,
homeApp: heroApp,
variants,
locale: 'en',
};
return (
<div>
{page.sections.map((section) => (
<SectionRenderer key={section.id} section={section} context={context} />
))}
</div>
);
}