Separated task in table view

This commit is contained in:
2025-11-11 13:52:43 +01:00
parent 0aaa6f8396
commit 849dd0050a
3 changed files with 62 additions and 34 deletions
+43
View File
@@ -0,0 +1,43 @@
import { Badge } from "@/components/ui/badge";
import { TableCell, TableRow } from "@/components/ui/table";
import { Task } from "@/lib/types";
import { Color, getColor } from "@/lib/ui/color";
export default function TableTask({
task,
setTask,
tags,
}: {
task: Task;
setTask: (t: Task) => void;
tags: Record<string, { color: Color; name: string }>;
}) {
return (
<TableRow>
<TableCell className="font-medium">{task.title}</TableCell>
<TableCell className="max-w-[250px] truncate">
{task.description || "-"}
</TableCell>
<TableCell>
<Badge
variant={
task.status === "done"
? "default"
: task.status === "in-progress"
? "secondary"
: "outline"
}
>
{task.status}
</Badge>
</TableCell>
<TableCell className="flex gap-1 items-center">
{task.tags?.map((tag, i) => (
<Badge key={tag} variant="outline" style={getColor(tags[tag].color)}>
{tag}
</Badge>
))}
</TableCell>
</TableRow>
);
}