/* Copyright (C) 2024 Manuel Bustillo*/ 'use client'; import React, { useState } from 'react'; import { TableArrangement, Guest } from '@/app/lib/definitions'; import { lusitana } from '@/app/ui/fonts'; import { Table } from '@/app/ui/components/table'; import { getSlug } from '@/app/lib/utils'; export default function Arrangement({ id }: { id: string }) { const [tables, setTables] = useState>([]); function loadTables() { fetch(`/api/${getSlug()}/tables_arrangements/${id}`) .then((response) => response.json()) .then((data) => { setTables(data.map((record: any) => { return ({ id: record.number, guests: record.guests }); })); }, (error) => { return []; }); } tables.length === 0 && loadTables(); return (

Table distributions

{tables.map((table) => ( ))} ) }