brain backup 2026-09-14
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
export function subjectsFor(units) {
|
||||
return ['All', ...new Set(units.map((unit) => unit.subject).filter(Boolean))].sort((a, b) => {
|
||||
if (a === 'All') return -1;
|
||||
if (b === 'All') return 1;
|
||||
return a.localeCompare(b);
|
||||
});
|
||||
}
|
||||
|
||||
export function filterUnits(units, subject) {
|
||||
return subject === 'All' ? units : units.filter((unit) => unit.subject === subject);
|
||||
}
|
||||
|
||||
export function teacherGuidesFor(unit) {
|
||||
return (unit.materials ?? []).filter((material) => material.role === 'Teacher Guide');
|
||||
}
|
||||
Reference in New Issue
Block a user