@@ -20,8 +20,6 @@ import { useState, useEffect, useRef, useMemo } from 'react'
|
|||||||
|
|
||||||
import { ImprovementCard } from './SaveAsignatura/ImprovementCardProps'
|
import { ImprovementCard } from './SaveAsignatura/ImprovementCardProps'
|
||||||
|
|
||||||
import type { IASugerencia } from '@/types/asignatura'
|
|
||||||
|
|
||||||
import ReferenciasParaIA from '@/components/planes/wizard/PasoDetallesPanel/ReferenciasParaIA'
|
import ReferenciasParaIA from '@/components/planes/wizard/PasoDetallesPanel/ReferenciasParaIA'
|
||||||
import { Avatar, AvatarFallback } from '@/components/ui/avatar'
|
import { Avatar, AvatarFallback } from '@/components/ui/avatar'
|
||||||
import { Button } from '@/components/ui/button'
|
import { Button } from '@/components/ui/button'
|
||||||
@@ -55,16 +53,7 @@ interface SelectedField {
|
|||||||
value: string
|
value: string
|
||||||
}
|
}
|
||||||
|
|
||||||
interface IAAsignaturaTabProps {
|
export function IAAsignaturaTab() {
|
||||||
asignatura?: Record<string, any>
|
|
||||||
onAcceptSuggestion: (sugerencia: IASugerencia) => void
|
|
||||||
onRejectSuggestion: (messageId: string) => void
|
|
||||||
}
|
|
||||||
|
|
||||||
export function IAAsignaturaTab({
|
|
||||||
onAcceptSuggestion,
|
|
||||||
onRejectSuggestion,
|
|
||||||
}: IAAsignaturaTabProps) {
|
|
||||||
const queryClient = useQueryClient()
|
const queryClient = useQueryClient()
|
||||||
const { asignaturaId } = useParams({
|
const { asignaturaId } = useParams({
|
||||||
from: '/planes/$planId/asignaturas/$asignaturaId',
|
from: '/planes/$planId/asignaturas/$asignaturaId',
|
||||||
@@ -147,7 +136,7 @@ export function IAAsignaturaTab({
|
|||||||
const dynamicFields = datosGenerales?.datos
|
const dynamicFields = datosGenerales?.datos
|
||||||
? Object.keys(datosGenerales.datos).map((key) => {
|
? Object.keys(datosGenerales.datos).map((key) => {
|
||||||
const estructuraProps =
|
const estructuraProps =
|
||||||
datosGenerales?.estructuras_asignatura?.definicion?.properties || {}
|
datosGenerales.estructuras_asignatura?.definicion?.properties || {}
|
||||||
return {
|
return {
|
||||||
key,
|
key,
|
||||||
label:
|
label:
|
||||||
|
|||||||
@@ -210,7 +210,7 @@ function RouteComponent() {
|
|||||||
return messages
|
return messages
|
||||||
})
|
})
|
||||||
}, [mensajesDelChat, activeChatId, availableFields])
|
}, [mensajesDelChat, activeChatId, availableFields])
|
||||||
const scrollToBottom = (behavior = 'smooth') => {
|
const scrollToBottom = (behavior: ScrollBehavior = 'smooth') => {
|
||||||
if (scrollRef.current) {
|
if (scrollRef.current) {
|
||||||
const scrollContainer = scrollRef.current.querySelector(
|
const scrollContainer = scrollRef.current.querySelector(
|
||||||
'[data-radix-scroll-area-viewport]',
|
'[data-radix-scroll-area-viewport]',
|
||||||
@@ -218,7 +218,7 @@ function RouteComponent() {
|
|||||||
if (scrollContainer) {
|
if (scrollContainer) {
|
||||||
scrollContainer.scrollTo({
|
scrollContainer.scrollTo({
|
||||||
top: scrollContainer.scrollHeight,
|
top: scrollContainer.scrollHeight,
|
||||||
behavior: behavior, // 'instant' para carga inicial, 'smooth' para mensajes nuevos
|
behavior,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -576,7 +576,7 @@ function RouteComponent() {
|
|||||||
onBlur={(e) => {
|
onBlur={(e) => {
|
||||||
if (editingChatId === chat.id) {
|
if (editingChatId === chat.id) {
|
||||||
const newTitle =
|
const newTitle =
|
||||||
e.currentTarget.textContent?.trim() || ''
|
e.currentTarget.textContent.trim() || ''
|
||||||
if (newTitle && newTitle !== chat.nombre) {
|
if (newTitle && newTitle !== chat.nombre) {
|
||||||
updateTitleMutation({
|
updateTitleMutation({
|
||||||
id: chat.id,
|
id: chat.id,
|
||||||
|
|||||||
Reference in New Issue
Block a user