import type { MetadataRoute } from "next";

// Aplikasi internal: blokir semua crawler (search engine & AI), kecuali bot
// link preview supaya tautan yang dibagikan di chat tetap tampil dengan kartu preview.
const LINK_PREVIEW_BOTS = [
  "facebookexternalhit", // WhatsApp, Facebook, Instagram
  "WhatsApp",
  "TelegramBot",
  "Twitterbot",
  "LinkedInBot",
  "Slackbot-LinkExpanding",
  "Discordbot",
];

export default function robots(): MetadataRoute.Robots {
  return {
    rules: [
      { userAgent: LINK_PREVIEW_BOTS, allow: "/" },
      { userAgent: "*", disallow: "/" },
    ],
  };
}
