add a "-" for no modifiers
Some checks failed
Deploy Website / docker (ubuntu-latest) (push) Failing after 1m0s
Some checks failed
Deploy Website / docker (ubuntu-latest) (push) Failing after 1m0s
This commit is contained in:
parent
57a9780fe8
commit
511f56af91
@ -14,14 +14,19 @@ type ScoreModifiersProps = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export function ScoreModifiers({ score, type }: ScoreModifiersProps) {
|
export function ScoreModifiers({ score, type }: ScoreModifiersProps) {
|
||||||
|
const modifiers = score.modifiers;
|
||||||
|
if (modifiers.length === 0) {
|
||||||
|
return <p>-</p>;
|
||||||
|
}
|
||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case "full":
|
case "full":
|
||||||
return <span>{score.modifiers.join(", ")}</span>;
|
return <span>{modifiers.join(", ")}</span>;
|
||||||
case "simple":
|
case "simple":
|
||||||
return (
|
return (
|
||||||
<span>
|
<span>
|
||||||
{Object.entries(Modifier)
|
{Object.entries(Modifier)
|
||||||
.filter(mod => score.modifiers.includes(mod[1] as Modifier))
|
.filter(mod => modifiers.includes(mod[1] as Modifier))
|
||||||
.map(mod => mod[0])
|
.map(mod => mod[0])
|
||||||
.join(",")}
|
.join(",")}
|
||||||
</span>
|
</span>
|
||||||
|
Reference in New Issue
Block a user