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}

) }