import type { MetadataRoute } from "next";
import { TOOL_PAGES } from "@/lib/tool-pages";
import { GUIDES } from "@/lib/guides";

const SITE_URL = "https://entscheidomat.com";

export default function sitemap(): MetadataRoute.Sitemap {
  return [
    {
      url: SITE_URL,
      lastModified: "2026-07-23",
      changeFrequency: "weekly",
      priority: 1,
    },
    ...TOOL_PAGES.map((t) => ({
      url: `${SITE_URL}/${t.slug}`,
      lastModified: t.lastModified,
      changeFrequency: "monthly" as const,
      priority: 0.8,
    })),
    {
      url: `${SITE_URL}/ratgeber`,
      lastModified: "2026-08-03",
      changeFrequency: "weekly" as const,
      priority: 0.8,
    },
    ...GUIDES.map((guide) => ({
      url: `${SITE_URL}/ratgeber/${guide.slug}`,
      lastModified: "2026-08-03",
      changeFrequency: "monthly" as const,
      priority: 0.7,
    })),
    {
      url: `${SITE_URL}/ueber-uns`,
      lastModified: "2026-08-03",
      changeFrequency: "yearly" as const,
      priority: 0.4,
    },
    {
      url: `${SITE_URL}/developer`,
      lastModified: "2026-08-01",
      changeFrequency: "weekly",
      priority: 0.9,
    },
    {
      url: `${SITE_URL}/impressum`,
      lastModified: "2026-07-23",
      changeFrequency: "yearly",
      priority: 0.2,
    },
    {
      url: `${SITE_URL}/datenschutz`,
      lastModified: "2026-07-23",
      changeFrequency: "yearly",
      priority: 0.2,
    },
  ];
}
