/* Copyright (C) 2024 Manuel Bustillo*/ 'use client'; import { Group, Guest } from '@/app/lib/definitions'; import CreationDialog from '@/app/ui/components/creation-dialog'; import GroupsTable from '@/app/ui/groups/table'; import AffinityGroupsTree from '@/app/ui/guests/affinity-groups-tree'; import SkeletonTable from '@/app/ui/guests/skeleton-row'; import GuestsTable from '@/app/ui/guests/table'; import { TabPanel, TabView } from 'primereact/tabview'; import { Suspense, useState } from 'react'; import { loadGuests } from '@/app/api/guests'; import { loadGroups } from '@/app/api/groups'; export default function Page() { function refreshGuests() { loadGuests((guests) => { setGuests(guests); setGuestsLoaded(true); }); } function refreshGroups() { loadGroups((groups) => { setGroups(groups); setGroupsLoaded(true); }); } const [groupsLoaded, setGroupsLoaded] = useState(false); const [groups, setGroups] = useState>([]); const [guestsLoaded, setGuestsLoaded] = useState(false); const [guests, setGuests] = useState>([]); !groupsLoaded && refreshGroups(); !guestsLoaded && refreshGuests(); return (
}>
}>
); }