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

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}/impressum`,
      lastModified: "2026-07-23",
      changeFrequency: "yearly",
      priority: 0.2,
    },
    {
      url: `${SITE_URL}/datenschutz`,
      lastModified: "2026-07-23",
      changeFrequency: "yearly",
      priority: 0.2,
    },
  ];
}
