import { Star } from 'lucide-react' import { cn } from '@/lib/utils' interface StarRatingProps { value: number onChange?: (value: number) => void readonly?: boolean size?: 'sm' | 'md' | 'lg' showCount?: boolean } const sizeClasses = { sm: 'h-4 w-4', md: 'h-5 w-5', lg: 'h-6 w-6' } export function StarRating({ value, onChange, readonly = false, size = 'md', showCount = false }: StarRatingProps) { const handleClick = (rating: number) => { if (!readonly && onChange) { onChange(rating) } } return (
{[1, 2, 3, 4, 5].map((star) => ( ))} {showCount && ( ({value}/5) )}
) }