Build a Star Rating component in React.
Requirements:
- Display a row of star icons (e.g., 5 stars).
- Clicking a star sets the rating to that value.
- Filled stars indicate the current rating.
- Users can change the rating by clicking a different star.
- Focus on functionality over styling.
- The component should work out-of-the-box in a live React preview (e.g., CodeSandbox/Sandpack).