feat(web): EMOTIONAL_MEMORY & IMPLICIT_MEMORY type user memory detail add refresh btn

This commit is contained in:
zhaoying
2026-01-19 18:51:50 +08:00
parent 21ae3cdd15
commit c255be8d09
10 changed files with 161 additions and 91 deletions

View File

@@ -1,13 +1,27 @@
import { type FC } from 'react'
import { forwardRef, useImperativeHandle, useRef } from 'react'
import { Row, Col, Space } from 'antd';
import { useParams } from 'react-router-dom'
import WordCloud from '../components/WordCloud'
import EmotionTags from '../components/EmotionTags'
import Health from '../components/Health'
import Suggestions from '../components/Suggestions'
import { generateSuggestions } from '@/api/memory'
const StatementDetail: FC = () => {
const StatementDetail = forwardRef((_props, ref) => {
const { id } = useParams()
const suggestionsRef = useRef<{ handleRefresh: () => void; }>(null)
const handleRefresh = () => {
if (!id) return
generateSuggestions(id)
.then(() => {
suggestionsRef.current?.handleRefresh()
})
}
useImperativeHandle(ref, () => ({
handleRefresh
}));
return (
<Row gutter={[16, 16]}>
<Col span={12}>
@@ -18,10 +32,10 @@ const StatementDetail: FC = () => {
</Space>
</Col>
<Col span={12}>
<Suggestions />
<Suggestions ref={suggestionsRef} />
</Col>
</Row>
)
}
})
export default StatementDetail