From 2b0fab797efb52357c3307f569831e5826f66a19 Mon Sep 17 00:00:00 2001 From: Manuel Bustillo Date: Mon, 9 Dec 2024 20:10:10 +0100 Subject: [PATCH] WIP groups tree table --- app/ui/groups/table.tsx | 92 ++++++++++++++++++++++++----------------- 1 file changed, 53 insertions(+), 39 deletions(-) diff --git a/app/ui/groups/table.tsx b/app/ui/groups/table.tsx index 5e1f0df..d17fdf9 100644 --- a/app/ui/groups/table.tsx +++ b/app/ui/groups/table.tsx @@ -6,6 +6,9 @@ import { Group, GroupSerializer } from '@/app/lib/group'; import TableOfContents from '../components/table-of-contents'; import { PencilIcon, TrashIcon } from '@heroicons/react/24/outline'; import { AbstractApi } from '@/app/api/abstract-api'; +import { TreeTable } from 'primereact/treetable'; +import { Column } from 'primereact/column'; +import { TreeNode } from 'primereact/treenode'; export default function GroupsTable({ groups, onUpdate, onEdit }: { groups: Group[], @@ -16,45 +19,56 @@ export default function GroupsTable({ groups, onUpdate, onEdit }: { const api = new AbstractApi(); const serializer = new GroupSerializer(); + const nodes:TreeNode[] = []; + + const headers = ['Name', 'Color', 'Confirmed', 'Tentative', 'Pending', 'Declined', 'Considered', 'Total', 'Actions']; + return ( - ( - - - {group.name} - - -
- - - {group.attendance?.confirmed} - - - {group.attendance?.tentative} - - - {group.attendance?.invited} - - - {group.attendance?.declined} - - - {group.attendance?.considered} - - - {group.attendance?.total} - - -
- { api.destroy(serializer, group, onUpdate) }} /> - onEdit(group)} /> -
- - - )} - /> + <> + + { headers.map((header, index) => )} + + + + ( + + + {group.name} + + +
+ + + {group.attendance?.confirmed} + + + {group.attendance?.tentative} + + + {group.attendance?.invited} + + + {group.attendance?.declined} + + + {group.attendance?.considered} + + + {group.attendance?.total} + + +
+ { api.destroy(serializer, group, onUpdate) }} /> + onEdit(group)} /> +
+ + + )} + /> + ) }