import { useTranslation } from 'react-i18next';
import { useProactiveSettings } from '@/api/aiProactive';
const categoryKeys = ['mail', 'tasks', 'contacts', 'companies', 'insights'];
export function ProactiveAISettings() {
const { t } = useTranslation();
const { settings, update } = useProactiveSettings();
if (!settings) {
return (
{/* Enable/Disable */}
{t('proactiveAI.title')}
{t('proactiveAI.toggleDescription')}
{/* Categories */}
{/* Confidence Threshold */}
{t('proactiveAI.confidenceThreshold')}
{Math.round((settings.confidence_threshold || 0.5) * 100)}%
{t('proactiveAI.confidenceDescription')}
update({ confidence_threshold: parseFloat(e.target.value) })}
className="w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer accent-blue-500"
/>
{t('proactiveAI.all')}
{t('proactiveAI.veryConfident')}
{/* Rate Limit */}
{t('proactiveAI.rateLimitTitle')}
{settings.rate_limit_seconds || 10}s
{t('proactiveAI.rateLimitDescription')}
update({ rate_limit_seconds: parseInt(e.target.value) })}
className="w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer accent-blue-500"
/>
5s
60s
{/* Model Selection */}
{t('proactiveAI.modelTitle')}
{t('proactiveAI.modelDescription')}
{/* Heartbeat Configuration */}
{t('proactiveAI.heartbeatTitle')}
{t('proactiveAI.heartbeatDescription')}
{settings.heartbeat_enabled && (
<>
{t('proactiveAI.interval')}
{settings.heartbeat_interval_seconds || 300}s
update({ heartbeat_interval_seconds: parseInt(e.target.value) })}
className="w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer accent-blue-500"
/>
1min
30min
>
)}
);
}