import { useRef, useState } from 'react'; import { getInitialWorkingDir } from '../utils/workingDir'; export default function LauncherView() { const [query, setQuery] = useState(''); const inputRef = useRef(null); const handleSubmit = (e: React.FormEvent) => { e.preventDefault(); if (query.trim()) { window.electron.createChatWindow(query, getInitialWorkingDir()); setQuery(''); } }; const handleKeyDown = (e: React.KeyboardEvent) => { // Close on Escape if (e.key === 'Escape') { window.electron.closeWindow(); } }; return (
setQuery(e.target.value)} onKeyDown={handleKeyDown} className="w-full h-full bg-transparent text-text-default text-xl px-6 outline-none placeholder-text-muted" placeholder="Ask goose anything..." autoFocus />
); }