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)} /> -
+ ) : ( + )}