46 lines
1.5 KiB
TypeScript
Raw Normal View History

/* Copyright (C) 2024 Manuel Bustillo*/
'use client';
import { Group } from '@/app/lib/definitions';
2024-11-17 16:10:01 +01:00
import TableOfContents from '../components/table-of-contents';
2024-11-17 16:10:01 +01:00
export default function GroupsTable({ groups }: { groups: Group[] }) {
return (
<TableOfContents
headers={['Name', 'Color', 'Confirmed', 'Tentative', 'Pending', 'Declined', 'Considered', 'Total']}
caption='Groups'
elements={groups}
rowRender={(group) => (
<tr key={group.id} className="bg-white border-b odd:bg-white odd:dark:bg-gray-900 even:bg-gray-50 even:dark:bg-gray-800">
<td scope="row" className="px-6 py-4 font-medium text-gray-900 whitespace-nowrap dark:text-white">
{group.name}
</td>
<td className="px-6">
<div className="w-8 h-8 rounded-full" style={{ backgroundColor: group.color }}></div>
</td>
2024-11-13 08:47:50 +01:00
<td className="px-6 text-lg">
{group.attendance?.confirmed}
</td>
2024-11-13 08:47:50 +01:00
<td className="px-6 text-sm">
{group.attendance?.tentative}
</td>
2024-11-13 08:47:50 +01:00
<td className="px-6 text-sm">
{group.attendance?.invited}
</td>
2024-11-13 08:47:50 +01:00
<td className="px-6 text-sm">
{group.attendance?.declined}
</td>
2024-11-13 08:47:50 +01:00
<td className="px-6 text-sm">
{group.attendance?.considered}
</td>
2024-11-13 08:47:50 +01:00
<td className="px-6 text-sm">
{group.attendance?.total}
</td>
</tr>
)}
/>
)
}