export const dynamic = "force-static";

import { MetadataRoute } from "next";

export default function sitemap(): MetadataRoute.Sitemap {
  const baseUrl = "https://promtechno.uz";

  // Static pages
  const staticPages = [
    {
      url: baseUrl,
      lastModified: new Date(),
      changeFrequency: "weekly" as const,
      priority: 1,
    },
  ];

  // Product detail pages - based on actual product slugs from API github
  const productSlugs = [
    "ppv-100-1-6-su-6-0-60-0-5foiz-mexanik-suyuqlik-hisoblagichi",
    "ppo-40-0-6-su-suyuqlik-hisoblagichi",
    "ppo-25-1-6-su-oval-tishli-suyuqlik-hisoblagichi",
    "scl-20-24-nasosi",
    "km-100-80-170e-elektro-nasosi",
    "scn-75-70-nasosi",
    "usn-150-04-pastdan-tushirish-quyi-oqizish-qurilmasi-ta-sir-zonasi-4-m",
    "asn-80-02-yuqoridan-quyish-qurilmasi",
    "usn-100-usn-76-neft-mahsulotlari-va-maxsus-suyuqliklarni-pastdan-oqizish-qurilmalari",
    "mexanik-nafas-olish-klapani-kdm-100-150-200-250-ichki-yong-inga-qarshi-himoyali",
    "fju-100-1-6-suyuqlik-filtri",
    "yoqilg-i-quyish-moduli-mz-35",
    "asvn-80-nasos-agregati",
  ];

  const productPages = productSlugs.map((slug) => ({
    url: `${baseUrl}/product/${slug}`,
    lastModified: new Date(),
    changeFrequency: "monthly" as const,
    priority: 0.8,
  }));

  return [...staticPages, ...productPages];
}
