import { useTranslation } from "react-i18next"; import { GlobalSystemPromptConfig } from "../../types/config"; interface GlobalSystemPromptProps { config: GlobalSystemPromptConfig; onChange: (config: GlobalSystemPromptConfig) => void; } const DEFAULT_CONFIG: GlobalSystemPromptConfig = { enabled: false, content: '', }; export default function GlobalSystemPrompt({ config = DEFAULT_CONFIG, onChange, }: GlobalSystemPromptProps) { const { t } = useTranslation(); return (
{/* 标题区域 (Compact) */}

{t("settings.global_system_prompt.title", { defaultValue: "全局系统提示词 (Global System Prompt)" })}

{t("settings.global_system_prompt.hint", { defaultValue: "自动注入所有请求的 systemInstruction" })}

{config.enabled ? t("common.enabled", { defaultValue: "已启用" }) : t("common.disabled", { defaultValue: "已禁用" })}
{/* 编辑区域 (仅在启用时显示) */} {config.enabled && (