diff --git a/parts/1/uniCafe/src/App.jsx b/parts/1/uniCafe/src/App.jsx index 1ab4c6b..7155b64 100644 --- a/parts/1/uniCafe/src/App.jsx +++ b/parts/1/uniCafe/src/App.jsx @@ -32,6 +32,39 @@ const App = () => { return good / computeTotalCount(); }; + const isThereAnyFeedback = () => { + return computeTotalCount() !== 0; + }; + + let feedbackSection; + if (isThereAnyFeedback()) { + feedbackSection = ( + <> + + + + + + + + ); + } else { + feedbackSection = ( + <> +

No feedback given.

+ + ); + } + return (
@@ -54,21 +87,7 @@ const App = () => { buttonText="bad" />
- - - - - - + {feedbackSection}
); // Buttons