import { useState, useEffect } from "react"; import ApiKeyInput from "./ApiKeyInput"; import DockerSettings from "./DockerSettings"; import AwsSettings from "./AwsSettings"; import { useSettings } from "../../hooks/useSettings"; import { useUpdates } from "../../hooks/useUpdates"; export default function SettingsPanel() { const { appSettings, saveSettings } = useSettings(); const { appVersion, checkForUpdates } = useUpdates(); const [globalInstructions, setGlobalInstructions] = useState(appSettings?.global_claude_instructions ?? ""); const [checkingUpdates, setCheckingUpdates] = useState(false); // Sync local state when appSettings change useEffect(() => { setGlobalInstructions(appSettings?.global_claude_instructions ?? ""); }, [appSettings?.global_claude_instructions]); const handleInstructionsBlur = async () => { if (!appSettings) return; await saveSettings({ ...appSettings, global_claude_instructions: globalInstructions || null }); }; const handleCheckNow = async () => { setCheckingUpdates(true); try { await checkForUpdates(); } finally { setCheckingUpdates(false); } }; const handleAutoCheckToggle = async () => { if (!appSettings) return; await saveSettings({ ...appSettings, auto_check_updates: !appSettings.auto_check_updates }); }; return (
Global instructions applied to all projects (written to ~/.claude/CLAUDE.md in containers)
Current version: {appVersion}
)}