diff --git a/frontend/src/components/EmotionalStats.tsx b/frontend/src/components/EmotionalStats.tsx index 62b9605..07b2eea 100644 --- a/frontend/src/components/EmotionalStats.tsx +++ b/frontend/src/components/EmotionalStats.tsx @@ -33,6 +33,11 @@ const EmotionalStats = ({contentData}: EmotionalStatsProps) => { }; }); + const formatEmotion = (value: string) => { + if (!value) return "Unknown"; + return value.charAt(0).toUpperCase() + value.slice(1); + }; + if (!rows.length) { return (
@@ -53,10 +58,19 @@ const EmotionalStats = ({contentData}: EmotionalStatsProps) => { {strongestPerTopic.map((topic) => (

{topic.topic}

-
Top emotion: {topic.emotion}
-

Model Confidence: {topic.value.toFixed(3)}

-
- Based on {topic.count} events +
+ Top Emotion +
+
+ {formatEmotion(topic.emotion)} +
+
+ Confidence + {topic.value.toFixed(3)} +
+
+ Sample Size + {topic.count} events
))}