Replace single-line reply input with resizable textarea in QuestionSplitView

This commit is contained in:
2026-05-19 18:01:27 +05:00
parent 751c012f3d
commit acf7ee49aa
@@ -323,11 +323,10 @@ export function QuestionSplitView({ currentUserId }: { currentUserId: string })
style={{ borderTop: "1px solid var(--border)" }} style={{ borderTop: "1px solid var(--border)" }}
> >
<div <div
className="flex gap-2" className="flex flex-col gap-2"
style={{ opacity: detail.status === "CLOSED" ? 0.5 : 1 }} style={{ opacity: detail.status === "CLOSED" ? 0.5 : 1 }}
> >
<input <textarea
type="text"
value={replyText} value={replyText}
onChange={(e) => setReplyText(e.target.value)} onChange={(e) => setReplyText(e.target.value)}
onKeyDown={(e) => { onKeyDown={(e) => {
@@ -340,13 +339,15 @@ export function QuestionSplitView({ currentUserId }: { currentUserId: string })
placeholder={ placeholder={
detail.status === "CLOSED" ? "Вопрос закрыт" : "Написать ответ..." detail.status === "CLOSED" ? "Вопрос закрыт" : "Написать ответ..."
} }
className="flex-1 text-sm px-3 py-2 outline-none" rows={4}
className="w-full text-sm px-3 py-2 outline-none resize-y"
style={{ style={{
border: "1px solid var(--border)", border: "1px solid var(--border)",
background: "var(--background)", background: "var(--background)",
color: "var(--foreground)", color: "var(--foreground)",
}} }}
/> />
<div className="flex justify-end">
<button <button
onClick={handleReply} onClick={handleReply}
disabled={sending || !replyText.trim() || detail.status === "CLOSED"} disabled={sending || !replyText.trim() || detail.status === "CLOSED"}
@@ -355,12 +356,13 @@ export function QuestionSplitView({ currentUserId }: { currentUserId: string })
background: "var(--foreground)", background: "var(--foreground)",
color: "var(--background)", color: "var(--background)",
border: "none", border: "none",
opacity: sending ? 0.6 : 1, opacity: sending || !replyText.trim() ? 0.5 : 1,
}} }}
> >
{sending ? "..." : "Отправить"} {sending ? "..." : "Отправить"}
</button> </button>
</div> </div>
</div>
{error && ( {error && (
<p className="text-xs mt-1" style={{ color: "var(--destructive)" }}> <p className="text-xs mt-1" style={{ color: "var(--destructive)" }}>
{error} {error}