diff --git a/app/dashboard/guests/page.tsx b/app/dashboard/guests/page.tsx index f829606..40214be 100644 --- a/app/dashboard/guests/page.tsx +++ b/app/dashboard/guests/page.tsx @@ -1,8 +1,8 @@ import { lusitana } from '@/app/ui/fonts'; import AffinityGroupsTree from '@/app/ui/guests/affinity-groups-tree'; import GuestsTable from '@/app/ui/guests/table'; -import { Tree } from 'primereact/tree'; -import React, { useState, useEffect } from 'react'; +import React, { Suspense } from 'react'; +import SkeletonTable from '@/app/ui/guests/skeleton-row'; @@ -10,10 +10,12 @@ export default function Page() { return (
- +

Guests

- + }> + +
); diff --git a/app/ui/guests/skeleton-row.tsx b/app/ui/guests/skeleton-row.tsx index 5cfe5b7..0b989e6 100644 --- a/app/ui/guests/skeleton-row.tsx +++ b/app/ui/guests/skeleton-row.tsx @@ -1,6 +1,6 @@ import Skeleton from '@/app/ui/skeleton'; -export default function SkeletonRow() { +export function SkeletonRow() { return ( {} @@ -9,4 +9,26 @@ export default function SkeletonRow() { {} ); -} \ No newline at end of file +} + +export default function SkeletonTable() { + return ( +
+ + + + + + {[...Array(20)].map((e, i) => )} + +
+ Guests +

+ Loading the list of guests... +

+
+
+ + ); +} + diff --git a/app/ui/guests/table.tsx b/app/ui/guests/table.tsx index 593b67f..6458d55 100644 --- a/app/ui/guests/table.tsx +++ b/app/ui/guests/table.tsx @@ -3,6 +3,10 @@ import SkeletonRow from './skeleton-row'; import { Suspense } from 'react'; import clsx from 'clsx'; +export function TableHeader() { + +} + export default async function guestsTable() { let guests: Guest[] = await fetch("http://localhost:3001/guests.json") @@ -45,36 +49,34 @@ export default async function guestsTable() { - )}> - {guests.map((guest) => ( - - - {guest.name} - - - {guest.email} - - - {guest.group_name} - - - - - - {guest.status} + {guests.map((guest) => ( + + + {guest.name} + + + {guest.email} + + + {guest.group_name} + + + + - - - ))} - + {guest.status} + + + + ))}