import { defineContentConfig, defineCollection, z } from "@nuxt/content";

const defineIndexSchema = () =>
  z.object({
    capabilities: z.object({
      title: z.string(),
      features: z.array(
        z.object({
          title: z.string(),
          description: z.string(),
          icon: z.string(),
        })
      ),
    }),
    featuredProjects: z.object({
      title: z.string(),
      projects: z.array(
        z.object({
          title: z.string(),
          description: z.string(),
          image: z.string(),
          demoLink: z.string(),
          highlight: z.boolean(),
          spotlight: z.boolean(),
        })
      ),
    }),
    techStack: z.object({
      title: z.string(),
    }),
    whyChooseUs: z.object({
      title: z.string(),
      features: z.array(
        z.object({
          title: z.string(),
          description: z.string(),
          icon: z.string(),
        })
      ),
    }),
  });

export default defineContentConfig({
  collections: {
    index_en: defineCollection({
      type: "page",
      source: "en-US/index.yml",
      schema: defineIndexSchema(),
    }),
    index_zh: defineCollection({
      type: "page",
      source: "zh-CN/index.yml",
      schema: defineIndexSchema(),
    }),
  },
});
