/* * @Author: ZhaoYing * @Date: 2026-02-03 17:57:26 * @Last Modified by: ZhaoYing * @Last Modified time: 2026-02-03 17:57:26 */ /** * Neo4j User Memory Detail View * Displays user memory details using Neo4j graph storage * Shows profile, interests, node statistics, relationships, and insights */ import { type FC, useRef, useState } from 'react' import { useParams } from 'react-router-dom' import { Row, Col, Space, Button } from 'antd' import { useTranslation } from 'react-i18next'; import PageHeader from './components/PageHeader' import EndUserProfile from './components/EndUserProfile' import AboutMe from './components/AboutMe' import InterestDistribution from './components/InterestDistribution' import NodeStatistics from './components/NodeStatistics' import RelationshipNetwork from './components/RelationshipNetwork' import MemoryInsight from './components/MemoryInsight' import type { EndUserProfileRef, MemoryInsightRef, AboutMeRef } from './types' import { analyticsRefresh, } from '@/api/memory' const Neo4j: FC = () => { const { t } = useTranslation(); const { id } = useParams() const [loading, setLoading] = useState(false) const [name, setName] = useState('') const ref = useRef(null) const memoryInsightRef = useRef(null) const aboutMeRef = useRef(null) /** Update displayed name */ const handleNameUpdate = (data: { other_name?: string; id: string }) => { setName(data.other_name && data.other_name !== '' ? data.other_name : data.id) } /** Refresh analytics data */ const handleRefresh = () => { setLoading(true) analyticsRefresh(id as string) .then(res => { const response = res as { insight_success: boolean; summary_success: boolean; } if (response.insight_success) { memoryInsightRef.current?.getData() } if (response.summary_success) { aboutMeRef.current?.getData() } }) .finally(() => { setLoading(false) }) } return (
{!loading &&
} {t('common.refresh')} )} />
) } export default Neo4j