feat(web): user memory feature optimize

This commit is contained in:
zhaoying
2026-01-22 12:26:37 +08:00
parent 783593a79d
commit da75abb223
9 changed files with 75 additions and 34 deletions

View File

@@ -21,6 +21,7 @@ interface Suggestions {
const Suggestions = forwardRef<{ handleRefresh: () => void; }>((_props, ref) => {
const { t } = useTranslation()
const { id } = useParams()
const [loading, setLoading] = useState(false)
const [suggestions, setSuggestions] = useState<Suggestions | null>(null)
useEffect(() => {
@@ -31,10 +32,14 @@ const Suggestions = forwardRef<{ handleRefresh: () => void; }>((_props, ref) =>
if (!id) {
return
}
setLoading(true)
getEmotionSuggestions(id)
.then((res) => {
setSuggestions(res as Suggestions)
})
.finally(() => {
setLoading(false)
})
}
useImperativeHandle(ref, () => ({
@@ -63,7 +68,7 @@ const Suggestions = forwardRef<{ handleRefresh: () => void; }>((_props, ref) =>
))}
</div>
</>
: <Empty size={88} className="rb:h-full" />
: <Empty size={88} subTitle={t(loading ? 'statementDetail.suggestionLoading' : 'empty.tableEmpty')} className="rb:h-full" />
}
</RbCard>
)