/**
 * Page Studio — Starter Templates
 * --------------------------------
 * Pre-filled page layouts the user can pick as a starting point. Each
 * template is an ordered list of block type ids; the Page Studio editor
 * calls createSection() for each type, yielding ready-to-edit sections
 * with defaultContent from the registry. The AI generator replaces the
 * placeholder copy with brand-specific content on first pass.
 */

import type { SectionCategory } from "./section-registry";

export interface PageTemplate {
  id: string;
  name: string;
  description: string;
  /** Which business purpose this template is tuned for */
  purpose: "lead_generation" | "service" | "product" | "event" | "coming_soon";
  /** lucide-react icon name — resolved in the picker UI */
  icon: string;
  /** Category tag shown on the template card */
  category: SectionCategory;
  /** Ordered list of block type ids — must exist in section-registry.ts */
  sectionTypes: string[];
}

export const PAGE_TEMPLATES: PageTemplate[] = [
  {
    id: "lead_generation",
    name: "Lead Generation",
    description: "High-converting page optimized to capture contact details from cold traffic.",
    purpose: "lead_generation",
    icon: "Target",
    category: "conversion",
    sectionTypes: [
      "hero",
      "trust_bar",
      "features_grid",
      "testimonials",
      "faq",
      "contact_form",
      "cta_banner",
    ],
  },
  {
    id: "service_page",
    name: "Service Page",
    description: "Clear service breakdown with process, proof, and a way to get in touch.",
    purpose: "service",
    icon: "Briefcase",
    category: "content",
    sectionTypes: [
      "hero",
      "services_list",
      "process_steps",
      "about_section",
      "reviews",
      "contact_form",
    ],
  },
  {
    id: "product_launch",
    name: "Product Launch",
    description: "Video-led launch page with features, pricing, and conversion CTA.",
    purpose: "product",
    icon: "Rocket",
    category: "layout",
    sectionTypes: [
      "hero_with_video",
      "features_grid",
      "pricing_table",
      "faq",
      "cta_banner",
    ],
  },
  {
    id: "event",
    name: "Event",
    description: "Focused event page with social proof stats and a single signup form.",
    purpose: "event",
    icon: "Calendar",
    category: "conversion",
    sectionTypes: [
      "hero",
      "stats_row",
      "features_grid",
      "contact_form",
    ],
  },
  {
    id: "coming_soon",
    name: "Coming Soon",
    description: "Minimal teaser page for waitlist collection.",
    purpose: "coming_soon",
    icon: "Clock",
    category: "layout",
    sectionTypes: [
      "hero",
      "contact_form",
    ],
  },
];

export function getTemplate(id: string): PageTemplate | undefined {
  return PAGE_TEMPLATES.find((t) => t.id === id);
}
