'use client';

import { FeatureGate } from '@/core/feature-flags';
import { useI18n } from '@/core/i18n';
import { AiChatModule } from '@/modules/ai-chat';

export default function AiChatPage() {
  const { t } = useI18n();

  return (
    <FeatureGate flag="module.ai-chat" fallback={<ModuleDisabled />}>
      <div className="mx-auto max-w-5xl space-y-6">
        <div>
          <h1 className="text-2xl font-bold tracking-tight">{t('ai-chat.title')}</h1>
          <p className="text-muted-foreground">{t('ai-chat.description')}</p>
        </div>
        <AiChatModule />
      </div>
    </FeatureGate>
  );
}

function ModuleDisabled() {
  return (
    <div className="flex min-h-[40vh] items-center justify-center">
      <p className="text-muted-foreground">Modul dezactivat</p>
    </div>
  );
}
