From 7a3d146892cd40dbcdbea0a749e10889b5b3e281 Mon Sep 17 00:00:00 2001 From: Nurfog Date: Mon, 2 Nov 2026 16:27:57 -0300 Subject: [PATCH] =?UTF-8?q?feat(respuesta):=20bot=C3=B3n=20=C3=BAnico=20de?= =?UTF-8?q?=20env=C3=ADo=20con=20opci=C3=B3n=20visible?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/app/(app)/tickets/[id]/page.tsx | 120 +++++++++---------- 1 file changed, 58 insertions(+), 62 deletions(-) diff --git a/frontend/src/app/(app)/tickets/[id]/page.tsx b/frontend/src/app/(app)/tickets/[id]/page.tsx index 9c5899d..57b9f31 100644 --- a/frontend/src/app/(app)/tickets/[id]/page.tsx +++ b/frontend/src/app/(app)/tickets/[id]/page.tsx @@ -226,11 +226,24 @@ export default function TicketDetailPage() { const [mergeError, setMergeError] = useState(""); const [merging, setMerging] = useState(false); const [sendMenuOpen, setSendMenuOpen] = useState(false); + const [sendAction, setSendAction] = useState<"send" | "resolved" | "closed">("send"); + + const SEND_ACTIONS = { + send: { label: "Enviar", icon: "bi-send", hint: "Solo publica el mensaje" }, + resolved: { label: "Enviar y resuelto", icon: "bi-check-circle", hint: "Publica y marca resuelto" }, + closed: { label: "Enviar y cerrado", icon: "bi-archive", hint: "Publica y archiva el ticket" }, + } as const; const handleAddComment = (e: React.FormEvent) => { e.preventDefault(); setSendMenuOpen(false); - void submitComment(); + void submitComment(sendAction === "send" ? undefined : sendAction); + }; + + const chooseSendAction = (action: "send" | "resolved" | "closed") => { + setSendAction(action); + setSendMenuOpen(false); + void submitComment(action === "send" ? undefined : action); }; useEffect(() => { @@ -832,31 +845,25 @@ export default function TicketDetailPage() { Nota interna (solo agentes) - - {isTeam && ( + {isTeam ? (
{sendMenuOpen && ( <> @@ -865,53 +872,42 @@ export default function TicketDetailPage() { style={{ zIndex: 1000 }} onClick={() => setSendMenuOpen(false)} /> -
+ ) : ( + )}