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 { getMemoryInsightReport, } from '@/api/memory' const MemoryInsight:FC = () => { const { t } = useTranslation() const { id } = useParams() const [loading, setLoading] = useState(false) const [report, setReport] = useState(null) useEffect(() => { if (!id) return getInsightReport() }, [id]) // 记忆洞察 const getInsightReport = () => { if (!id) return setLoading(true) getMemoryInsightReport(id).then((res) => { setReport((res as { report?: string }).report || null) setLoading(false) }) .finally(() => { setLoading(false) }) } return ( {loading ? : report ?
{report|| '-'}
: }
) } export default MemoryInsight