( groupedTasks: ReadonlyMap<string, readonly TaskInfo[]>, collapsedGroups: ReadonlySet<string> )
| 242 | } |
| 243 | |
| 244 | export function buildTaskListSubPropertyRenderItems( |
| 245 | groupedTasks: ReadonlyMap<string, readonly TaskInfo[]>, |
| 246 | collapsedGroups: ReadonlySet<string> |
| 247 | ): TaskListRenderItem[] { |
| 248 | const items: TaskListRenderItem[] = []; |
| 249 | |
| 250 | for (const [groupKey, tasks] of groupedTasks) { |
| 251 | if (tasks.length === 0) continue; |
| 252 | |
| 253 | const isCollapsed = collapsedGroups.has(groupKey); |
| 254 | items.push({ |
| 255 | type: "primary-header", |
| 256 | groupKey, |
| 257 | groupTitle: groupKey, |
| 258 | taskCount: tasks.length, |
| 259 | groupEntries: [], |
| 260 | isCollapsed, |
| 261 | }); |
| 262 | |
| 263 | if (!isCollapsed) { |
| 264 | for (const task of tasks) { |
| 265 | items.push({ type: "task", task, groupKey }); |
| 266 | } |
| 267 | } |
| 268 | } |
| 269 | |
| 270 | return items; |
| 271 | } |
no test coverage detected