import React, { useState, useMemo, useRef, useEffect } from 'react'; import { ChevronRight, Download, Settings2, Search, Check, Eye, EyeOff, FileText, Square, CheckSquare } from 'lucide-react'; export default function DevMenu({ allModels, orchestratorModel, onOrchestratorChange, personaMode, onPersonaModeChange, roleStyle, onRoleStyleChange, speedPriority, onSpeedPriorityChange, showResponseTime, onShowResponseTimeChange, showChatStats, onShowChatStatsChange, rolePrompts, onShowRolePrompts, onDownloadApiLog, onDownloadChatTxt, onDownloadChatMd, hasApiLog, hasChat, }) { const [open, setOpen] = useState(false); const [orchOpen, setOrchOpen] = useState(false); const [q, setQ] = useState(''); const wrapRef = useRef(null); const searchRef = useRef(null); useEffect(() => { if (orchOpen && searchRef.current) searchRef.current.focus(); }, [orchOpen]); useEffect(() => { function handleClickOutside(e) { if (wrapRef.current && !wrapRef.current.contains(e.target)) { setOpen(false); setOrchOpen(false); setQ(''); } } document.addEventListener('mousedown', handleClickOutside); return () => document.removeEventListener('mousedown', handleClickOutside); }, []); const filtered = useMemo(() => { const s = q.trim().toLowerCase(); if (!s) return allModels; return allModels.filter(row => { const hay = `${row.name} ${row.id} ${row.provider || ''}`.toLowerCase(); return hay.includes(s); }); }, [allModels, q]); const currentName = useMemo(() => { if (!orchestratorModel) return 'Default (backend)'; const m = allModels.find(m => m.id === orchestratorModel); return m ? m.name : orchestratorModel; }, [orchestratorModel, allModels]); return (
{open && (
Response priority
Expert persona input
Role generation
Display options
)} {open && orchOpen && (
Orchestrator {currentName}
setQ(e.target.value)} />
  • {filtered.map(m => (
  • ))}
)}
); }