File size: 576 Bytes
f5d25f5
 
f43196f
f5d25f5
 
f43196f
f5d25f5
 
f43196f
f5d25f5
 
 
f43196f
f5d25f5
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
'use client'
import { SentimentDisplay } from "@/components/sentiment-display/SentimentDisplay";
import { ClassifyOutputElement } from "@/util/classify";

export interface ISentimentList {
  out?: ClassifyOutputElement[];
}

export function SentimentList({ out }: ISentimentList) {
  return (
    <div className="flex flex-col gap-8 p-12 overflow-y-auto">
      {Array.isArray(out) ?
        out.map(({ label, score }) =>
          <SentimentDisplay key={label} label={label} value={score} />
        ) :
        <p>Begin to write to see results!</p>
      }
    </div>
  )
}