exercise 1.7

This commit is contained in:
Anish Lakhwara 2023-05-15 21:17:10 +10:00
parent 711764b874
commit 5f6a727ee6

View file

@ -1,12 +1,17 @@
import { useState } from 'react'
const Stats = ({ positive, neutral, negative }) => {
const total = positive - negative
const votes = positive + neutral + negative
return (
<>
<h2> Results </h2>
<p> Positive: {positive} </p>
<p> Neutral: {neutral} </p>
<p> Negative: {negative} </p>
<p> All: {votes} </p>
<p> Average: {total / votes} </p>
<p> Positive: {positive / votes} </p>
</>
)
}