import * as React from 'react'; import Rating from '@mui/material/Rating'; import Box from '@mui/material/Box'; import StarIcon from '@mui/icons-material/Star'; const labels = { 0.5: 'Useless', 1: 'Useless+', 1.5: 'Poor', 2: 'Poor+', 2.5: 'Ok', 3: 'Ok+', 3.5: 'Good', 4: 'Good+', 4.5: 'Excellent', 5: 'Excellent+', }; function getLabelText(value) { return `${value} Star${value !== 1 ? 's' : ''}, ${labels[value]}`; } export default function HoverRating() { const [value, setValue] = React.useState(2); const [hover, setHover] = React.useState(-1); return ( { setValue(newValue); }} onChangeActive={(event, newHover) => { setHover(newHover); }} emptyIcon={} /> {value !== null && ( {labels[hover !== -1 ? hover : value]} )} ); }