Create a star rating widget that allows users to select a rating value.
The star icons, both empty and filled, are provided as SVGs.
The prompt specifies that zero is allowed initially and clicking the selected star keeps its rating. The Svelte solution also updates the filled stars when the selection or hover preview changes.
The React, Vue, Angular, and Vanilla JavaScript solutions use buttons for the stars so a focused star can be selected from the keyboard. The Vanilla JavaScript example also demonstrates the rating callback.
The widget takes a callback in addition to the maximum and current rating. It reports the new rating when the user changes it.
A star-rating.tsx skeleton component has been created for you. You are free to decide the props of <StarRating />.