import { type FC, useEffect, useState } from 'react' import { useTranslation } from 'react-i18next' import { useParams } from 'react-router-dom' import Empty from '@/components/Empty' import RbCard from '@/components/RbCard/Card' import { getEmotionSuggestions } from '@/api/memory' import RbAlert from '@/components/RbAlert' interface Suggestions { health_summary: string; suggestions: Array<{ type: string; title: string; content: string; priority: string; actionable_steps: string[]; }>; } const Suggestions: FC = () => { const { t } = useTranslation() const { id } = useParams() const [suggestions, setSuggestions] = useState(null) useEffect(() => { getSuggestionData() }, [id]) const getSuggestionData = () => { if (!id) { return } getEmotionSuggestions(id) .then((res) => { setSuggestions(res as Suggestions) }) } return ( {suggestions?.suggestions && suggestions?.suggestions.length > 0 ? <> {suggestions.health_summary}
{suggestions.suggestions.map((item, index) => (
{index + 1}. {item.title}
{item.content}
    {item.actionable_steps.map((vo, idx) =>
  • {vo}
  • )}
))}
: }
) } export default Suggestions