import type { ResourceSlug, ResourceSummary } from "@/content/types";

/**
 * Resource index: titles, deks, and categories. Article bodies live in
 * src/content/resources/<slug>.ts and spread this summary, so titles stay in one place.
 */
export const resourceCatalog: ResourceSummary[] = [
  {
    slug: "saas-cac-benchmarking-guide",
    title: "SaaS CAC Benchmarking Guide",
    dek: "How to calculate, segment, and compare CAC without fooling yourself.",
    category: "SaaS",
    format: "Guide",
    models: ["saas"],
    publishedAt: "2026-09-17",
  },
  {
    slug: "mer-vs-roas-guide",
    title: "E-commerce MER vs ROAS Guide",
    dek: "When to trust platform ROAS, when to trust MER, and how to use both.",
    category: "E-commerce",
    format: "Guide",
    models: ["ecommerce"],
    publishedAt: "2026-09-17",
  },
  {
    slug: "landing-page-experiment-checklist",
    title: "Landing Page Experiment Checklist",
    dek: "What to check before, during, and after a landing page test.",
    category: "CRO",
    format: "Checklist",
    models: ["saas", "ecommerce"],
    publishedAt: "2026-09-17",
  },
  {
    slug: "paid-search-account-audit-checklist",
    title: "Paid Search Account Audit Checklist",
    dek: "A structured review of tracking, structure, queries, bidding, and budget.",
    category: "Paid media",
    format: "Checklist",
    models: ["saas", "ecommerce"],
    publishedAt: "2026-09-17",
  },
  {
    slug: "attribution-readiness-guide",
    title: "Attribution Readiness Guide",
    dek: "What has to be true before attribution data can guide budget.",
    category: "Measurement",
    format: "Guide",
    models: ["saas", "ecommerce"],
    publishedAt: "2026-09-17",
  },
  {
    slug: "ai-search-visibility-guide",
    title: "AI Search Visibility Guide",
    dek: "How AI answers choose sources, and what you can influence.",
    category: "SEO + AI search",
    format: "Guide",
    models: ["saas", "ecommerce"],
    publishedAt: "2026-09-17",
  },
];

export function getResourceSummary(slug: ResourceSlug): ResourceSummary {
  const summary = resourceCatalog.find((item) => item.slug === slug);
  if (!summary) throw new Error(`Unknown resource: ${slug}`);
  return summary;
}
