mirror of
https://github.com/AustinKelsay/plebdevs.git
synced 2025-06-06 18:31:00 +00:00
Reformat contentOptions in lessonSelector in CourseForm
This commit is contained in:
parent
e212f2f4f0
commit
4e4904bbf8
@ -38,34 +38,41 @@ const LessonSelector = ({ isPaidCourse, lessons, setLessons, allContent }) => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log("filteredContent", filteredContent);
|
const draftResourceOptions = filteredContent.filter(content => content?.topics.includes('resource') && !content.kind).map(content => ({
|
||||||
|
|
||||||
const draftOptions = filteredContent.filter(content => !content.kind).map(content => ({
|
|
||||||
label: content.title,
|
label: content.title,
|
||||||
value: content
|
value: content
|
||||||
}));
|
}));
|
||||||
|
|
||||||
const resourceOptions = filteredContent.filter(content => content?.topics.includes('resource')).map(content => ({
|
const draftWorkshopOptions = filteredContent.filter(content => content?.topics.includes('workshop') && !content.kind).map(content => ({
|
||||||
label: content.title,
|
label: content.title,
|
||||||
value: content
|
value: content
|
||||||
}));
|
}));
|
||||||
|
|
||||||
const workshopOptions = filteredContent.filter(content => content?.topics.includes('workshop')).map(content => ({
|
const resourceOptions = filteredContent.filter(content => content?.topics.includes('resource') && content.kind).map(content => ({
|
||||||
|
label: content.title,
|
||||||
|
value: content
|
||||||
|
}));
|
||||||
|
|
||||||
|
const workshopOptions = filteredContent.filter(content => content?.topics.includes('workshop') && content.kind).map(content => ({
|
||||||
label: content.title,
|
label: content.title,
|
||||||
value: content
|
value: content
|
||||||
}));
|
}));
|
||||||
|
|
||||||
setContentOptions([
|
setContentOptions([
|
||||||
{
|
{
|
||||||
label: 'Drafts',
|
label: 'Draft Resources',
|
||||||
items: draftOptions
|
items: draftResourceOptions
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'Resources',
|
label: 'Draft Workshops',
|
||||||
|
items: draftWorkshopOptions
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Published Resources',
|
||||||
items: resourceOptions
|
items: resourceOptions
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'Workshops',
|
label: 'Published Workshops',
|
||||||
items: workshopOptions
|
items: workshopOptions
|
||||||
}
|
}
|
||||||
]);
|
]);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user