Spaces:
Sleeping
Sleeping
File size: 818 Bytes
f2bfbb5 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | 'use client';
import styles from './TopPredictions.module.css';
export default function TopPredictions({ predictions }) {
if (!predictions || predictions.length <= 1) return null;
const runnersUp = predictions.slice(1, 5);
return (
<div className={styles.container}>
<h4 className={styles.title}>Other Possibilities</h4>
<ul className={styles.list}>
{runnersUp.map((pred, index) => (
<li
key={pred.pokemon_id}
className={styles.item}
style={{ animationDelay: `${index * 100}ms` }}
>
<span className={styles.name}>{pred.name}</span>
<span className={`${styles.prob} mono`}>
{(pred.confidence * 100).toFixed(1)}%
</span>
</li>
))}
</ul>
</div>
);
}
|