From ba86b457f48367f2cd2c38cb132d17552b424cfb Mon Sep 17 00:00:00 2001 From: Aditya Pawar Date: Sun, 21 Apr 2024 11:28:09 -0700 Subject: [PATCH] Make content card use string[] --- src/components/ContentCard/ContentCard.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/ContentCard/ContentCard.tsx b/src/components/ContentCard/ContentCard.tsx index 7a0ad17..6d895f1 100644 --- a/src/components/ContentCard/ContentCard.tsx +++ b/src/components/ContentCard/ContentCard.tsx @@ -34,15 +34,16 @@ function ContentCard({ storyId, pressFunction, }: ContentCardProps) { - const [reactions, setReactions] = useState(); + const [reactions, setReactions] = useState(); useEffect(() => { (async () => { const temp = await fetchAllReactionsToStory(id); if (temp != null) { - setReactions(temp); + setReactions(temp.map(r => r.reaction)); return; } + setReactions([]); })(); }, []);