mirror of
https://github.com/MrPatben8/konduktor.git
synced 2026-11-27 10:22:51 +01:00
21 lines
515 B
TypeScript
21 lines
515 B
TypeScript
interface Props {
|
|
value: number
|
|
}
|
|
|
|
// Compact 5-star rating. Filled stars use the gold accent; empties are faint.
|
|
export function RatingStars({ value }: Props) {
|
|
if (!value) return <span className="text-faint">—</span>
|
|
return (
|
|
<span className="whitespace-nowrap tracking-tight" title={`${value} / 5`}>
|
|
{[1, 2, 3, 4, 5].map((i) => (
|
|
<span
|
|
key={i}
|
|
className={i <= value ? 'text-gold' : 'text-ink-600'}
|
|
>
|
|
★
|
|
</span>
|
|
))}
|
|
</span>
|
|
)
|
|
}
|