mirror of
https://github.com/hanzo-apps/gallery.git
synced 2026-10-30 14:48:38 +00:00
15 lines
461 B
TypeScript
15 lines
461 B
TypeScript
import { XStack, Text } from '@hanzo/ui';
|
|
|
|
/** Five stars, `n` of them lit, in the page's one ink. */
|
|
export function Stars({ n, size = '$3' }: { n: number; size?: '$2' | '$3' | '$6' | '$7' }) {
|
|
return (
|
|
<XStack aria-label={`${n} of 5`} gap={2}>
|
|
{[0, 1, 2, 3, 4].map((i) => (
|
|
<Text key={i} aria-hidden fontSize={size} color={i < n ? 'var(--foreground)' : 'var(--text-disabled)'}>
|
|
★
|
|
</Text>
|
|
))}
|
|
</XStack>
|
|
);
|
|
}
|