/** * PromptInput is the message composer: Enter sends (Shift+Enter for a new * line); while a turn runs the send button becomes a stop button, matching * the behaviour of Zed's agent panel. * * @example * console.log(t)} onCancel={() => {}} /> */ import { useState } from "react"; interface PromptInputProps { turnActive: boolean; onSend: (text: string) => void; onCancel: () => void; } export function PromptInput({ turnActive, onSend, onCancel, }: PromptInputProps) { const [text, setText] = useState(""); const submit = () => { const trimmed = text.trim(); if (trimmed === "" || turnActive) { return; } onSend(trimmed); setText(""); }; return (
{ event.preventDefault(); submit(); }} >