export default defineEventHandler(async (event) => {
  const robotsTxt = `User-agent: *
Allow: /

# Sitemap
Sitemap: https://khalejauto.sa/sitemap.xml

# Disallow admin or private areas
Disallow: /admin/
Disallow: /api/
Disallow: /_nuxt/
Disallow: /order-company
Disallow: /order-individuals
Disallow: /*?*

# Crawl delay
Crawl-delay: 1`;

  setHeader(event, "Content-Type", "text/plain");
  setHeader(event, "Cache-Control", "public, max-age=86400"); // Cache for 1 day

  return robotsTxt;
});
