From bcb9fdb027debc054c365fa1d7ed78cd5e5962eb Mon Sep 17 00:00:00 2001 From: Klesti Selimaj Date: Fri, 27 Feb 2026 23:09:07 +0100 Subject: [PATCH] Status stuff --- src/components/view/board/BoardView.tsx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/components/view/board/BoardView.tsx b/src/components/view/board/BoardView.tsx index bb4e752..6f3b5c4 100644 --- a/src/components/view/board/BoardView.tsx +++ b/src/components/view/board/BoardView.tsx @@ -12,6 +12,7 @@ export default function BoardView({ tasks, setTasks, createTask, + statuses, }: TaskViewProps) { function onDragEnd(result: any) { const { draggableId, source, destination } = result; @@ -32,13 +33,12 @@ export default function BoardView({ // Group tasks by status, using statuses from first available todo entity const tasksArray = Object.values(tasks); - const statusIds = new Set(tasksArray.map((t) => t.statusId)); // Sort tasks by creation date within each status - const tasksByStatus = Array.from(statusIds).map((statusId) => ({ - statusId, + const tasksByStatus = statuses.map((status) => ({ + status, tasks: tasksArray - .filter((t) => t.statusId === statusId) + .filter((t) => t.statusId === status.id) .sort((a, b) => a.createdAt - b.createdAt), })); @@ -46,8 +46,8 @@ export default function BoardView({
- {tasksByStatus.map(({ statusId, tasks: statusTasks }) => ( - + {tasksByStatus.map(({ status, tasks: statusTasks }) => ( + {(provided) => ( - {statusId} + {status.name}