import { fetchPublicTemplates } from '@/lib/templates-server';
import { TemplatesBrowser } from './templates-browser';

// Server component: fetch the default (all/trending) template list at render
// time so the marketplace grid is present in the initial HTML for crawlers.
// All interactivity (search, filters, scope) lives in TemplatesBrowser.
export const revalidate = 300;

export default async function TemplatesPage() {
  const { templates, categories } = await fetchPublicTemplates();
  return <TemplatesBrowser initialTemplates={templates} initialCategories={categories} />;
}
