Skip to content

Commit 7b6152c

Browse files
author
Pascal Wegner
committed
Add counter component
1 parent 959cdbd commit 7b6152c

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import * as React from 'react';
2+
3+
import { DurationInput } from '../DurationInput/DurationInput';
4+
5+
type CounterProps = {
6+
timeLeft: Date;
7+
roundsLeft: number;
8+
rounds: number;
9+
};
10+
11+
export function Counter({ timeLeft, roundsLeft, rounds }: CounterProps) {
12+
return (
13+
<div className="flex flex-col items-center">
14+
<div className="flex flex-col items-center mb-20">
15+
<span className="text-blue-600 text-lg font-bold">ROUND</span>
16+
<span className="text-4xl" data-testid={'round'}>{`${
17+
rounds - roundsLeft
18+
}/${rounds}`}</span>
19+
</div>
20+
<div className="">
21+
<div className=""></div>
22+
<DurationInput value={timeLeft} readOnly dataTestId={'time-left'} />
23+
</div>
24+
</div>
25+
);
26+
}

0 commit comments

Comments
 (0)