"use client"; import { useCallback, useEffect, useId, useState } from "react"; const STORAGE_KEY = "haiku.rag.settings.background_context"; interface SettingsPanelProps { isOpen: boolean; onClose: () => void; onSave: (backgroundContext: string) => void; currentValue: string; } export default function SettingsPanel({ isOpen, onClose, onSave, currentValue, }: SettingsPanelProps) { const [value, setValue] = useState(currentValue); const titleId = useId(); useEffect(() => { if (isOpen) { setValue(currentValue); } }, [isOpen, currentValue]); const handleSave = useCallback(() => { onSave(value); onClose(); }, [value, onSave, onClose]); const handleKeyDown = useCallback( (e: React.KeyboardEvent) => { if (e.key === "Escape") { onClose(); } }, [onClose], ); if (!isOpen) { return null; } return ( <>
{/* biome-ignore lint/a11y/noStaticElementInteractions: modal content wrapper */}
e.stopPropagation()} onKeyDown={(e) => e.stopPropagation()} >

Background Context

Provide background information that will be used throughout your conversation. This helps the assistant understand domain-specific context, terminology, or any relevant details about your questions.