import type { MetadataRoute } from "next";
import {
  absoluteUrl,
  entityPages,
  machineReadableFiles
} from "./content/pop-media";

export default function sitemap(): MetadataRoute.Sitemap {
  const now = new Date();

  return [
    {
      url: absoluteUrl("/"),
      lastModified: now,
      changeFrequency: "weekly",
      priority: 1
    },
    ...entityPages.map((page) => ({
      url: absoluteUrl(`/${page.slug}`),
      lastModified: now,
      changeFrequency: "monthly" as const,
      priority: page.slug === "publicitate" || page.slug === "contact" ? 0.9 : 0.75
    })),
    ...machineReadableFiles.map((file) => ({
      url: absoluteUrl(file.path),
      lastModified: now,
      changeFrequency: "weekly" as const,
      priority: 0.45
    }))
  ];
}
