{level?.data?.introduction &&
{level?.data?.introduction}
}
{proof.map((step, i) => {
// It the last step has errors, it will have the same hints
// as the second-to-last step. Therefore we should not display them.
if (!(i == proof.length - 1 && hasInteractiveErrors(step.errors))) {
// TODO: Should not use index as key.
return
}
})}
{completed &&
<>
Level completed! 🎉
{level?.data?.conclusion?.trim() &&
{level?.data?.conclusion}
}
{levelId >= gameInfo.data?.worldSize[worldId] ?
:
}
>
}
{
console.debug(proof.length)
if (!(proof.length)) {return}
let k = proof.length - 1
// state must not be mutated, therefore we need to clone the set
let tmp = new Set(showHelp)
if (tmp.has(k)) {
tmp.delete(k)
} else {
tmp.add(k)
}
setShowHelp(tmp)
console.debug(`help: ${Array.from(tmp.values())}`)
}} />}
label="Show more help!"
/>