From 5f6a727ee689ac02a71a026aee0abb8e2c9af215 Mon Sep 17 00:00:00 2001 From: Anish Lakhwara Date: Mon, 15 May 2023 21:17:10 +1000 Subject: [PATCH] exercise 1.7 --- part1/src/App.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/part1/src/App.js b/part1/src/App.js index ea413aa..ab73ad6 100644 --- a/part1/src/App.js +++ b/part1/src/App.js @@ -1,12 +1,17 @@ import { useState } from 'react' const Stats = ({ positive, neutral, negative }) => { + const total = positive - negative + const votes = positive + neutral + negative return ( <>

Results

Positive: {positive}

Neutral: {neutral}

Negative: {negative}

+

All: {votes}

+

Average: {total / votes}

+

Positive: {positive / votes}

) }