MCPcopy Create free account
hub / github.com/code100x/chess / getTimer

Function getTimer

apps/frontend/src/screens/Game.tsx:220–232  ·  view source on GitHub ↗
(timeConsumed: number)

Source from the content-addressed store, hash-verified

218 }, [started, gameMetadata, user]);
219
220 const getTimer = (timeConsumed: number) => {
221 const timeLeftMs = GAME_TIME_MS - timeConsumed;
222 const minutes = Math.floor(timeLeftMs / (1000 * 60));
223 const remainingSeconds = Math.floor((timeLeftMs % (1000 * 60)) / 1000);
224
225 return (
226 <div className="text-white">
227 Time Left: {minutes < 10 ? '0' : ''}
228 {minutes}:{remainingSeconds < 10 ? '0' : ''}
229 {remainingSeconds}
230 </div>
231 );
232 };
233
234 const handleExit = () => {
235 socket?.send(

Callers 1

GameFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected