import { useState } from "react";
const Button = ({ handleClick, text }) => {
return ;
};
const StatisticsLine = ({ text, value }) => {
return (
| {text} |
{value} |
);
};
const Statistics = ({ good, neutral, bad }) => {
if (good + neutral + bad === 0 || !(good || neutral || bad)) {
return No feedback given
;
} else {
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 (
give feedback
);
};
export default App;