/* Copyright (C) 2024 Manuel Bustillo*/ 'use client'; import { destroyGuest, updateGuest } from '@/app/api/guests'; import { Guest, GuestStatus } from '@/app/lib/definitions'; import { classNames } from '@/app/ui/components/button'; import { PencilIcon, TrashIcon } from '@heroicons/react/24/outline'; import clsx from 'clsx'; import TableOfContents from '../components/table-of-contents'; export default function guestsTable({ guests, onUpdate, onEdit }: { guests: Guest[], onUpdate: () => void, onEdit: (guest: Guest) => void }) { const handleGuestChange = (guest: Guest, status: GuestStatus) => { guest.status = status; updateGuest(guest).then(() => onUpdate()); } return ( ( {guest.name} {guest.group_name} {guest.status}
{guest.status === 'considered' && ()} {(guest.status === 'invited' || guest.status === 'tentative') && ( <> {guest.status != 'tentative' && } )} { destroyGuest(guest, () => onUpdate()) }} /> onEdit(guest)} />
)} /> ); }