import { useState } from "react"; import { Button } from "~/ui/Button"; import { TextAreaField } from "~/ui/Field"; type Props = { pending: boolean; /** Current text of the selected lines, used to prefill a ```suggestion block. Null when not suggestible. */ suggestionSeed: string | null; rangeLabel: string | null; onSubmit: (body: string) => void; onCancel: () => void; onSingle: (body: string) => void; }; export function ReviewComposer({ pending, suggestionSeed, rangeLabel, onSubmit, onCancel, onSingle }: Props) { const [body, setBody] = useState(""); return (
{rangeLabel && {rangeLabel}} {suggestionSeed !== null && ( )}
setBody(event.target.value)} rows={4} className="font-mono" autoFocus />
); }