From 511f56af910f8402ba51077509aa29f368dabf05 Mon Sep 17 00:00:00 2001 From: Liam Date: Sun, 20 Oct 2024 13:44:36 +0100 Subject: [PATCH] add a "-" for no modifiers --- .../website/src/components/score/score-modifiers.tsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/projects/website/src/components/score/score-modifiers.tsx b/projects/website/src/components/score/score-modifiers.tsx index eba45ba..f6549f2 100644 --- a/projects/website/src/components/score/score-modifiers.tsx +++ b/projects/website/src/components/score/score-modifiers.tsx @@ -14,14 +14,19 @@ type ScoreModifiersProps = { }; export function ScoreModifiers({ score, type }: ScoreModifiersProps) { + const modifiers = score.modifiers; + if (modifiers.length === 0) { + return

-

; + } + switch (type) { case "full": - return {score.modifiers.join(", ")}; + return {modifiers.join(", ")}; case "simple": return ( {Object.entries(Modifier) - .filter(mod => score.modifiers.includes(mod[1] as Modifier)) + .filter(mod => modifiers.includes(mod[1] as Modifier)) .map(mod => mod[0]) .join(",")}