// utils/sitemap.ts
// import { sitemap } from 'xmlbuilder';
// import { create } from 'xmlbuilder2';

import xmlbuilder from 'xmlbuilder';
export async function sitemapXml() {
  const baseUrl = 'https://indispare.com'; 
  const pages = ['/',"/aboutUs","/contactUs"]; // Add the routes you want in the sitemap

  const root = xmlbuilder.create('urlset', { version: '1.0', encoding: 'UTF-8' })
    .att('xmlns', 'http://www.sitemaps.org/schemas/sitemap/0.9');

  pages.forEach((page) => {
    root.ele('url')
      .ele('loc', baseUrl + page).up()
      .ele('lastmod', new Date().toISOString()).up()
      .ele('changefreq', 'monthly').up()
      .ele('priority', '1.0').up();
  });

  return root.end({ pretty: true });
}
