import { type FC, useEffect, useState } from 'react' import { useTranslation } from 'react-i18next' import { useParams } from 'react-router-dom' import { Skeleton } from 'antd'; import RbCard from '@/components/RbCard/Card' import Empty from '@/components/Empty'; import { List } from 'antd'; import Markdown from '@/components/Markdown' import { getRagContent } from '@/api/memory' const ConversationMemory:FC = () => { const { t } = useTranslation() const { id } = useParams() const [loading, setLoading] = useState(true) const [list, setList] = useState([]) useEffect(() => { if (!id) return getList() }, [id]) const getList = () => { if (!id) return setLoading(true) getRagContent(id).then((res) => { setList((res as { contents?: [] }).contents || []) }) .finally(() => { setLoading(false) }) } return ( {loading ? : list.length > 0 ? (
)} /> : }
) } export default ConversationMemory