import type { MetadataRoute } from "next";
import { comando, publicBaseUrl } from "@/lib/comando";

export default function sitemap(): MetadataRoute.Sitemap {
  return comando.pages.filter((page) => page.indexing.startsWith("index")).map((page) => ({
    url: new URL(page.route, publicBaseUrl()).toString(),
    lastModified: new Date("2026-08-31T00:00:00.000Z"),
    changeFrequency: page.category === "commercial" ? "weekly" : "monthly",
    priority: page.route === "/" ? 1 : page.category === "commercial" ? 0.8 : 0.4,
  }));
}
