add a "-" for no modifiers
Some checks failed
Deploy Website / docker (ubuntu-latest) (push) Failing after 1m0s

This commit is contained in:
Lee 2024-10-20 13:44:36 +01:00
parent 57a9780fe8
commit 511f56af91

View File

@ -14,14 +14,19 @@ type ScoreModifiersProps = {
};
export function ScoreModifiers({ score, type }: ScoreModifiersProps) {
const modifiers = score.modifiers;
if (modifiers.length === 0) {
return <p>-</p>;
}
switch (type) {
case "full":
return <span>{score.modifiers.join(", ")}</span>;
return <span>{modifiers.join(", ")}</span>;
case "simple":
return (
<span>
{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(",")}
</span>