import type { ReactNode } from "react"; import type { SectionBaseProps } from "./context"; import { useTranslation } from "react-i18next"; export interface ResearchProjectSectionProps extends SectionBaseProps { scopeBanner: ReactNode; researchLimitError: string | null; } export function ResearchProjectSection({ scopeBanner, form, setForm, researchLimitError }: ResearchProjectSectionProps) { const { t } = useTranslation("app"); const limits = form.researchSettings?.limits; const sources = form.researchSettings?.enabledSources; return (<> {scopeBanner}

{t("settings.researchProject.projectResearchSettings", "Project Research Settings")}

{t("settings.researchProject.webSearchIsAlwaysEnabledConfigureTheSearch", " Web search is always enabled. Configure the search provider under Research Defaults. ")}
{[ ["pageFetch", t("settings.researchProject.pageFetch", "Page Fetch")], ["github", t("settings.researchProject.github", "GitHub")], ["localDocs", t("settings.researchProject.localDocs", "Local Docs")], ["llmSynthesis", t("settings.researchProject.llmSynthesis", "LLM Synthesis")], ].map(([key, label]) => ())}
setForm((current) => ({ ...current, researchSettings: { ...(current.researchSettings ?? {}), limits: { ...(current.researchSettings?.limits ?? {}), maxConcurrentRuns: event.target.value === "" ? undefined : Number(event.target.value), }, }, }))}/>
setForm((current) => ({ ...current, researchSettings: { ...(current.researchSettings ?? {}), limits: { ...(current.researchSettings?.limits ?? {}), maxSourcesPerRun: event.target.value === "" ? undefined : Number(event.target.value), }, }, }))}/>
setForm((current) => ({ ...current, researchSettings: { ...(current.researchSettings ?? {}), limits: { ...(current.researchSettings?.limits ?? {}), maxDurationMs: event.target.value === "" ? undefined : Number(event.target.value), }, }, }))}/>
setForm((current) => ({ ...current, researchSettings: { ...(current.researchSettings ?? {}), limits: { ...(current.researchSettings?.limits ?? {}), requestTimeoutMs: event.target.value === "" ? undefined : Number(event.target.value), }, }, }))}/>
{researchLimitError && {researchLimitError}}
); } export default ResearchProjectSection;