Implementado. Ahora cuando el asistente termine de responder, aparecerá un botón verde "✓ Continuar con la Inspección" que cierra el chat y permite al mecánico seguir trabajando en la inspección. El botón solo se muestra cuando:
No está cargando (!loading) Hay mensajes en el chat (messages.length > 0) El último mensaje es del asistente (messages[messages.length - 1].role === 'assistant')
This commit is contained in:
@@ -5419,7 +5419,7 @@ function InspectionModal({ checklist, existingInspection, user, onClose, onCompl
|
||||
className="w-full mt-3 px-4 py-3 bg-gradient-to-r from-purple-600 to-blue-600 text-white rounded-lg hover:from-purple-700 hover:to-blue-700 transition flex items-center justify-center gap-2 font-semibold shadow-lg"
|
||||
>
|
||||
<span>💬</span>
|
||||
<span>Consultar Asistente</span>
|
||||
<span>Verificación de Incidencia</span>
|
||||
{answers[currentQuestion.id]?.chatHistory?.length > 0 && (
|
||||
<span className="ml-1 px-2 py-0.5 bg-white/20 rounded-full text-xs">
|
||||
{answers[currentQuestion.id].chatHistory.length} mensajes
|
||||
@@ -6290,6 +6290,19 @@ function AIAssistantChatModal({ question, inspection, allAnswers, messages, setM
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Botón Continuar después del mensaje del asistente */}
|
||||
{!loading && messages.length > 0 && messages[messages.length - 1].role === 'assistant' && (
|
||||
<div className="flex justify-center mt-4">
|
||||
<button
|
||||
onClick={onClose}
|
||||
className="px-6 py-3 bg-gradient-to-r from-green-600 to-emerald-600 text-white rounded-lg hover:from-green-700 hover:to-emerald-700 transition font-semibold shadow-lg flex items-center gap-2"
|
||||
>
|
||||
<span>✓</span>
|
||||
<span>Continuar con la Inspección</span>
|
||||
</button>
|
||||
</div>
|
||||
)}
|
||||
|
||||
<div ref={chatEndRef} />
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user