recipe author and stars and a bit of cleanup

This commit is contained in:
fred 2025-07-24 12:11:32 -07:00
parent c47dac9986
commit 6f43d17ddd
21 changed files with 361 additions and 207 deletions

View file

@ -0,0 +1,26 @@
interface StarRatingProps {
rating: number;
onRatingChange: (newRating: number) => void;
}
const StarRating = ({ rating, onRatingChange }: StarRatingProps) => {
return (
<div>
{[...Array(5)].map((star, index) => {
index += 1;
return (
<span
key={index}
onClick={() => onRatingChange(index)}
style={{ color: index <= rating ? 'gold' : 'gray', fontSize: '2rem', cursor: 'pointer' }}
>
</span>
);
})}
</div>
);
};
export default StarRating;