ENCOA-255 Fixed the level import

This commit is contained in:
Carlos-Mesquita
2024-12-03 12:00:04 +00:00
parent 490c5ad7d3
commit 5252faafb7
5 changed files with 31 additions and 25 deletions

View File

@@ -94,7 +94,13 @@ export const sectionLabels = (module: Module, levelParts?: number) => {
label: `Section ${index + 1}`
}));
case 'level':
return [{ id: 1, label: "Part 1" }];
return levelParts !== undefined ?
Array.from({ length: levelParts }, (_, index) => ({
id: index + 1,
label: `Part ${index + 1}`
}))
:
[{ id: 1, label: "Part 1" }];
}
}