diff --git a/src/components/asignaturas/detalle/IAAsignaturaTab.tsx b/src/components/asignaturas/detalle/IAAsignaturaTab.tsx index 34946ac..3deb579 100644 --- a/src/components/asignaturas/detalle/IAAsignaturaTab.tsx +++ b/src/components/asignaturas/detalle/IAAsignaturaTab.tsx @@ -20,12 +20,15 @@ import { useState, useEffect, useRef, useMemo } from 'react' import { ImprovementCard } from './SaveAsignatura/ImprovementCardProps' -import type { IASugerencia } from '@/types/asignatura' - import ReferenciasParaIA from '@/components/planes/wizard/PasoDetallesPanel/ReferenciasParaIA' import { Avatar, AvatarFallback } from '@/components/ui/avatar' import { Button } from '@/components/ui/button' -import { Drawer, DrawerContent } from '@/components/ui/drawer' +import { + Drawer, + DrawerContent, + DrawerOverlay, + DrawerPortal, +} from '@/components/ui/drawer' import { ScrollArea } from '@/components/ui/scroll-area' import { Textarea } from '@/components/ui/textarea' import { @@ -50,16 +53,7 @@ interface SelectedField { value: string } -interface IAAsignaturaTabProps { - asignatura?: Record - onAcceptSuggestion: (sugerencia: IASugerencia) => void - onRejectSuggestion: (messageId: string) => void -} - -export function IAAsignaturaTab({ - onAcceptSuggestion, - onRejectSuggestion, -}: IAAsignaturaTabProps) { +export function IAAsignaturaTab() { const queryClient = useQueryClient() const { asignaturaId } = useParams({ from: '/planes/$planId/asignaturas/$asignaturaId', @@ -75,6 +69,7 @@ export function IAAsignaturaTab({ const [showSuggestions, setShowSuggestions] = useState(false) const [isSending, setIsSending] = useState(false) const scrollRef = useRef(null) + const [isSidebarOpen, setIsSidebarOpen] = useState(false) // --- DATA QUERIES --- const { data: datosGenerales } = useSubject(asignaturaId) @@ -141,7 +136,7 @@ export function IAAsignaturaTab({ const dynamicFields = datosGenerales?.datos ? Object.keys(datosGenerales.datos).map((key) => { const estructuraProps = - datosGenerales?.estructuras_asignatura?.definicion?.properties || {} + datosGenerales.estructuras_asignatura?.definicion?.properties || {} return { key, label: @@ -355,10 +350,35 @@ export function IAAsignaturaTab({ ] return ( -
- {/* PANEL IZQUIERDO */} -
-
+
+
+ + +
+ + Asistente + +
+ + +
+ {/* 1. PANEL IZQUIERDO (HISTORIAL) - Desktop */} + - {/* PANEL CENTRAL */} -
+ {/* 2. PANEL CENTRAL (CHAT) - EL RECUADRO ESTILIZADO */} +
+ {/* Header Interno del Recuadro */}
- - Asistente IA - - +
+ + Asistente Académico - )} - + + Personalizado para tu asignatura + +
+
+ +
+ +
+ {/* Área de Mensajes */}
-
+
{messages.map((msg) => (
- {/* INPUT */} -
-
- {showSuggestions && ( -
-
- Filtrando campos... - - ESC para cerrar - -
-
- {filteredFields.length > 0 ? ( - filteredFields.map((field) => ( - - )) - ) : ( -
- No se encontraron coincidencias -
- )} -
-
- )} - -
- {selectedFields.length > 0 && ( -
- {selectedFields.map((field) => ( -
- - {field.label} - -
- ))} + {/* Input de Chat */} +