From 66f385dbb0fa2574267e60413c06ffbe4f7e7a76 Mon Sep 17 00:00:00 2001 From: Sasha Chabin Date: Tue, 27 Aug 2024 02:46:01 +0500 Subject: [PATCH] Fix traffic jam counter --- .../components/MainPage/Card/CardDynamic/CardTrafficJams.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/components/MainPage/Card/CardDynamic/CardTrafficJams.tsx b/client/components/MainPage/Card/CardDynamic/CardTrafficJams.tsx index b69dffe5..f10bdb78 100644 --- a/client/components/MainPage/Card/CardDynamic/CardTrafficJams.tsx +++ b/client/components/MainPage/Card/CardDynamic/CardTrafficJams.tsx @@ -5,7 +5,7 @@ import React from "react"; const cn = classNames.bind(styles); const getTrafficLightByScore = (score: any) => { - const scoreNumber = parseInt(score?.toString()); + const scoreNumber = Number(score); if (scoreNumber < 4) { return styles.CardTrafficLight_Green; } else if (scoreNumber < 7) { @@ -17,7 +17,7 @@ const getTrafficLightByScore = (score: any) => { export function CardTrafficJams({ score }) { return (
- {score} + {Number(score)}
) }