import type { MetadataRoute } from 'next'

export default function sitemap(): MetadataRoute.Sitemap {
  const baseUrl = 'https://therapyathome.in'
  const lastModified = new Date()

  const blogSlugs = [
    'physiotherapy-at-home-coimbatore',
    'back-pain-not-going-away',
    'what-is-abhyanga-massage',
    'why-home-physiotherapy-treatment-growing-india',
    'home-physiotherapy-vs-clinic-coimbatore',
    'physiotherapy-ayurveda-home-theni',
    'knee-pain-not-going-away',
    'frozen-shoulder-home-physiotherapy',
    'sciatica-pain-relief-at-home',
    'cervical-spondylosis-desk-jobs',
    'arthritis-elderly-parents-home-care',
    'plantain-leaf-bath-therapy',
  ]

  const staticRoutes: MetadataRoute.Sitemap = [
    {
      url: baseUrl,
      lastModified,
      changeFrequency: 'weekly',
      priority: 1,
    },
    {
      url: `${baseUrl}/blog`,
      lastModified,
      changeFrequency: 'weekly',
      priority: 0.8,
    },
  ]

  const blogRoutes: MetadataRoute.Sitemap = blogSlugs.map((slug) => ({
    url: `${baseUrl}/blog/${slug}`,
    lastModified,
    changeFrequency: 'monthly',
    priority: 0.7,
  }))

  return [...staticRoutes, ...blogRoutes]
}