'use client' import { useEffect, useState } from 'react' import { getSettings, updateSettings } from '@/lib/api-client' import type { SettingsFormState } from '../types' const DEFAULTS: SettingsFormState = { deep_think_llm: 'gpt-5.2', quick_think_llm: 'gpt-5-mini', max_debate_rounds: 1, max_risk_discuss_rounds: 1, } export default function SettingsForm() { const [form, setForm] = useState(DEFAULTS) const [saved, setSaved] = useState(false) const set = (k: keyof SettingsFormState, v: unknown) => setForm((f) => ({ ...f, [k]: v })) useEffect(() => { getSettings().then(setForm).catch(() => {}) }, []) const save = async (e: React.FormEvent) => { e.preventDefault() await updateSettings(form) setSaved(true) setTimeout(() => setSaved(false), 2000) } return (
{/* ── Model Configuration ─────────────────────────────────── */}

Model Configuration

{(['deep_think_llm', 'quick_think_llm'] as const).map((key) => (
set(key, e.target.value)} />
))}
{/* ── Analysis Parameters ─────────────────────────────────── */}

Analysis Parameters

{(['max_debate_rounds', 'max_risk_discuss_rounds'] as const).map((key) => (
set(key, Number(e.target.value))} />
))}
{/* ── Security notice ─────────────────────────────────────── */}
API keys and secrets are configured via .env on the server and are not editable here.
{/* ── Actions ─────────────────────────────────────────────── */}
) }