import type { MetadataRoute } from 'next';
import { getSiteOrigin } from '@/lib/localization/site-origin';

export default function robots(): MetadataRoute.Robots {
  const origin = getSiteOrigin();
  const approved = process.env.PUBLIC_RELEASE_APPROVED === 'true';
  return {
    rules: approved ? { userAgent: '*', allow: '/' } : { userAgent: '*', disallow: '/' },
    host: origin.href,
  };
}
