Working system

This commit is contained in:
2026-02-27 22:51:02 +01:00
parent 162e2b3d3f
commit 5895974af2
17 changed files with 356 additions and 332 deletions
+10 -3
View File
@@ -15,6 +15,10 @@ import { getColor } from "@/lib/ui/color";
import TableTask from "./Task";
export function TableView({ tasks, setTasks, tags }: TaskViewProps) {
const tasksArray = Object.values(tasks).sort(
(a, b) => b.createdAt - a.createdAt,
);
return (
<Table>
<TableHeader>
@@ -26,7 +30,7 @@ export function TableView({ tasks, setTasks, tags }: TaskViewProps) {
</TableRow>
</TableHeader>
<TableBody>
{tasks.length === 0 ? (
{tasksArray.length === 0 ? (
<TableRow>
<TableCell
colSpan={5}
@@ -36,12 +40,15 @@ export function TableView({ tasks, setTasks, tags }: TaskViewProps) {
</TableCell>
</TableRow>
) : (
tasks.map((task) => (
tasksArray.map((task) => (
<TableTask
key={task.id}
task={task}
setTask={(t) =>
setTasks((tasks) => tasks.map((c) => (c.id === t.id ? t : c)))
setTasks({
...tasks,
[t.id]: t,
})
}
tags={tags}
/>