)
}
const Statistics = (props) => {
const good = props.good
const bad = props.bad
const neutral = props.neutral
if (good === 0 && bad === 0 && neutral === 0) {
return
No feedback given
}
const total = good + neutral + bad
const average = (good - bad) / 9.0
const positive_percent = (good/total) * 100
return (
)
}
const App = () => {
// save clicks of each button to its own state
const [good, setGood] = useState(0)
const [neutral, setNeutral] = useState(0)
const [bad, setBad] = useState(0)
return (