diff --git a/part1/unicafe/src/App.js b/part1/unicafe/src/App.js index da124b5..4640e71 100644 --- a/part1/unicafe/src/App.js +++ b/part1/unicafe/src/App.js @@ -1,6 +1,6 @@ import { useState } from "react"; -const Button = (props) => { - return ; +const Button = ({ handleClick, text }) => { + return ; }; // StatistticsLine should display as a HTML table const StatisticsLine = ({ text, value }) => { @@ -11,30 +11,23 @@ const StatisticsLine = ({ text, value }) => { ); }; -const Statistics = (props) => { - if (props.good + props.neutral + props.bad === 0) { +const Statistics = ({ good, neutral, bad }) => { + if (good + neutral + bad === 0 || !(good || neutral || bad)) { return

No feedback given

; } else { return (
- - - - + + + +
);