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
+19 -17
View File
@@ -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,26 +339,29 @@ 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)",
}} }}
/> />
<button <div className="flex justify-end">
onClick={handleReply} <button
disabled={sending || !replyText.trim() || detail.status === "CLOSED"} onClick={handleReply}
className="text-xs font-bold px-4 py-2" disabled={sending || !replyText.trim() || detail.status === "CLOSED"}
style={{ className="text-xs font-bold px-4 py-2"
background: "var(--foreground)", style={{
color: "var(--background)", background: "var(--foreground)",
border: "none", color: "var(--background)",
opacity: sending ? 0.6 : 1, border: "none",
}} opacity: sending || !replyText.trim() ? 0.5 : 1,
> }}
{sending ? "..." : "Отправить"} >
</button> {sending ? "..." : "Отправить →"}
</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)" }}>