// MEDIUM PRIORITY FIX #4: Create Sitemap.xml

// File: public/sitemap.xml
// This file tells search engines about all your pages

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
        xmlns:image="http://www.google.com/schemas/sitemap-image/1.1"
        xmlns:video="http://www.google.com/schemas/sitemap-video/1.1">

  <!-- Homepage -->
  <url>
    <loc>https://www.al-ghaith.ae/</loc>
    <lastmod>2026-02-23</lastmod>
    <changefreq>weekly</changefreq>
    <priority>1.0</priority>
    <image:image>
      <image:loc>https://www.al-ghaith.ae/images/Al-Ghaith-X.webp</image:loc>
      <image:title>Al Ghaith Properties Logo</image:title>
    </image:image>
  </url>

  <!-- About Page -->
  <url>
    <loc>https://www.al-ghaith.ae/about</loc>
    <lastmod>2026-02-23</lastmod>
    <changefreq>monthly</changefreq>
    <priority>0.9</priority>
  </url>

  <!-- Services Page -->
  <url>
    <loc>https://www.al-ghaith.ae/services</loc>
    <lastmod>2026-02-23</lastmod>
    <changefreq>monthly</changefreq>
    <priority>0.9</priority>
  </url>

  <!-- Projects Overview -->
  <url>
    <loc>https://www.al-ghaith.ae/projects</loc>
    <lastmod>2026-02-23</lastmod>
    <changefreq>weekly</changefreq>
    <priority>0.95</priority>
  </url>

  <!-- Individual Property Pages -->
  <url>
    <loc>https://www.al-ghaith.ae/projects/villa</loc>
    <lastmod>2026-02-23</lastmod>
    <changefreq>weekly</changefreq>
    <priority>0.8</priority>
  </url>

  <url>
    <loc>https://www.al-ghaith.ae/projects/apartment</loc>
    <lastmod>2026-02-23</lastmod>
    <changefreq>weekly</changefreq>
    <priority>0.8</priority>
  </url>

  <url>
    <loc>https://www.al-ghaith.ae/projects/commercial</loc>
    <lastmod>2026-02-23</lastmod>
    <changefreq>weekly</changefreq>
    <priority>0.8</priority>
  </url>

  <url>
    <loc>https://www.al-ghaith.ae/projects/administrative</loc>
    <lastmod>2026-02-23</lastmod>
    <changefreq>monthly</changefreq>
    <priority>0.7</priority>
  </url>

  <url>
    <loc>https://www.al-ghaith.ae/projects/medical</loc>
    <lastmod>2026-02-23</lastmod>
    <changefreq>monthly</changefreq>
    <priority>0.7</priority>
  </url>

  <url>
    <loc>https://www.al-ghaith.ae/projects/pharmacies</loc>
    <lastmod>2026-02-23</lastmod>
    <changefreq>monthly</changefreq>
    <priority>0.7</priority>
  </url>

  <url>
    <loc>https://www.al-ghaith.ae/projects/Upcoming Projects</loc>
    <lastmod>2026-02-23</lastmod>
    <changefreq>weekly</changefreq>
    <priority>0.8</priority>
  </url>

  <!-- Contact Page -->
  <url>
    <loc>https://www.al-ghaith.ae/contact</loc>
    <lastmod>2026-02-23</lastmod>
    <changefreq>monthly</changefreq>
    <priority>0.8</priority>
  </url>

  <!-- Careers Page -->
  <url>
    <loc>https://www.al-ghaith.ae/careers</loc>
    <lastmod>2026-02-23</lastmod>
    <changefreq>weekly</changefreq>
    <priority>0.7</priority>
  </url>

  <!-- FAQ Page -->
  <url>
    <loc>https://www.al-ghaith.ae/faq</loc>
    <lastmod>2026-02-23</lastmod>
    <changefreq>monthly</changefreq>
    <priority>0.7</priority>
  </url>

</urlset>

// ✅ UPDATE robots.txt to reference sitemap:
// File: public/robots.txt
/*
User-agent: *
Allow: /
Sitemap: https://www.al-ghaith.ae/sitemap.xml
*/

// ✅ NEXT STEPS:
// 1. Add this file to public/sitemap.xml
// 2. Update robots.txt with Sitemap reference
// 3. Submit to Google Search Console:
//    a. Go to https://search.google.com/search-console/
//    b. Select property
//    c. Sitemaps → Add new sitemap
//    d. Enter: https://www.al-ghaith.ae/sitemap.xml
// 4. Submit to Bing Webmaster Tools similarly

// ✅ DYNAMIC SITEMAP GENERATION (for future):
// If you want to auto-generate from routes, install:
/*
npm install react-router-sitemap
*/

// Then create: scripts/generate-sitemap.js
/*
const fetch = require('node-fetch');
const fs = require('fs');
const path = require('path');

const routes = [
  '/',
  '/about',
  '/services',
  '/projects',
  '/projects/villa',
  '/projects/apartment',
  '/projects/commercial',
  '/contact',
  '/careers',
  '/faq'
];

const baseURL = 'https://www.al-ghaith.ae';

const generateSitemap = () => {
  const sitemap = `<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
${routes.map(route => `
  <url>
    <loc>${baseURL}${route}</loc>
    <lastmod>${new Date().toISOString().split('T')[0]}</lastmod>
    <changefreq>weekly</changefreq>
    <priority>${route === '/' ? 1.0 : 0.8}</priority>
  </url>
`).join('')}
</urlset>`;

  fs.writeFileSync(path.join(__dirname, '../public/sitemap.xml'), sitemap);
  console.log('✅ Sitemap generated');
};

generateSitemap();
*/

// Add to package.json:
/*
"scripts": {
  "generate-sitemap": "node scripts/generate-sitemap.js",
  "build": "npm run generate-sitemap && react-scripts build"
}
*/
