diff --git a/.gitignore b/.gitignore index 1a1e372..8ace1e6 100644 --- a/.gitignore +++ b/.gitignore @@ -44,3 +44,4 @@ node_modules/ /blob-report/ /playwright/.cache/ /playwright/.auth/ +.swc diff --git a/src/components/ui/card/UiCard.tsx b/src/components/ui/card/UiCard.tsx index ea612d9..f5e228e 100644 --- a/src/components/ui/card/UiCard.tsx +++ b/src/components/ui/card/UiCard.tsx @@ -19,6 +19,9 @@ const UiCard = ({ isSingleBook, }: Props) => { const imageObject = useMemo(() => { + if (!totalScore) { + return { src: UNKNOWN_IMAGE, textColor: "#FFFFFF", text: "" } + } if (hideScores) { return { src: UNKNOWN_IMAGE, textColor: "#FFFFFF", text: "" } } @@ -77,7 +80,7 @@ const UiCard = ({ color: imageObject.textColor, fontSize: isSingleBook ? "3rem" : "1.5rem", }} - >{`${hideScores ? "?" : totalScore?.toFixed(1) + "/10"}`} + >{`${hideScores ? "?" : totalScore ? totalScore?.toFixed(1) + "/10" : "?"}`}