diff --git a/client/src/apps/score_calculator/ScoreCalculator.tsx b/client/src/apps/score_calculator/ScoreCalculator.tsx index c153f0c..57db14b 100644 --- a/client/src/apps/score_calculator/ScoreCalculator.tsx +++ b/client/src/apps/score_calculator/ScoreCalculator.tsx @@ -3,6 +3,7 @@ import React, { Dispatch, SetStateAction, useState } from 'react'; import LinkButton from '../../components/LinkButton'; import { MaterialSymbol } from 'react-material-symbols'; +import NumberInput from '../../components/NumberInput'; function Counter({ value, @@ -42,6 +43,14 @@ function ScoreCalculator() { const [trap, setTrap] = useState(0); const [harmony, setHarmony] = useState(0); + const [foulPoints, setFoulPoints] = useState(0); + + const autoPoints = autoLeave * 2; + const speakerPoints = autoSpeaker * 5 + teleSpeaker * 2 + ampedTeleSpeaker * 5; + const ampPoints = autoAmp * 2 + teleAmp * 1; + const stagePoints = park * 1 + climb * 3 + climbSpot * 4 + trap * 5 + harmony * 2; + const totalPoints = autoPoints + speakerPoints + ampPoints + stagePoints + (foulPoints ?? 0); + const handleReset = () => { setAutoLeave(0); setAutoSpeaker(0); @@ -54,6 +63,7 @@ function ScoreCalculator() { setClimbSpot(0); setTrap(0); setHarmony(0); + setFoulPoints(0); }; return ( @@ -81,7 +91,7 @@ function ScoreCalculator() {
@@ -137,7 +147,7 @@ function ScoreCalculator() {

Leave:{' '} - {autoLeave * 2} + {autoPoints}

@@ -145,27 +155,33 @@ function ScoreCalculator() { className={` text-black-100 text-md rounded-md border-green-800 bg-green-400/70 px-3 py-2 text-center`}> Speaker:{' '} - {autoSpeaker * 5 + - teleSpeaker * 2 + - ampedTeleSpeaker * 5} + {speakerPoints}

Amp:{' '} - {autoAmp * 2 + teleAmp * 1} + {ampPoints}

Stage:{' '} - {park * 1 + - climb * 3 + - climbSpot * 4 + - trap * 5 + - harmony * 2} + {stagePoints} + +

+ +

+ Foul Points:{' '} + +

+ +

+ Total:{' '} + + {totalPoints}