diff --git a/app/lib/definitions.ts b/app/lib/definitions.ts
index 4a9f09e..c182c95 100644
--- a/app/lib/definitions.ts
+++ b/app/lib/definitions.ts
@@ -26,6 +26,20 @@ export type Guest = {
status?: 'Considered' | 'Invited' | 'Confirmed' | 'Declined' | 'Tentative';
}
+export type Banana = {
+ id: string;
+ name: string;
+ email?: string;
+ group_name?: string;
+ status?: 'Considered' | 'Invited' | 'Confirmed' | 'Declined' | 'Tentative';
+}
+
+export type TableArrangement = {
+ number: number;
+ guests: Guest[];
+ discomfort?: number
+}
+
export type Group = {
id: string;
name: string;
diff --git a/app/ui/arrangements/arrangement.tsx b/app/ui/arrangements/arrangement.tsx
new file mode 100644
index 0000000..5da1c3f
--- /dev/null
+++ b/app/ui/arrangements/arrangement.tsx
@@ -0,0 +1,44 @@
+'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';
+
+export default function Arrangement({ id }: { id: string }) {
+
+ const [guests, setGuests] = useState
>([]);
+ const [tables, setTables] = useState>([]);
+
+
+ function loadTables() {
+ fetch(`/api/tables_arrangements/${id}`)
+ .then((response) => response.json())
+ .then((data) => {
+ setTables(data.map((record: any) => {
+ return ({
+ id: record.id,
+ guests: record.guests
+ });
+ }));
+ }, (error) => {
+ return [];
+ });
+ }
+
+ tables.length === 0 && loadTables();
+
+ return (
+
+
+
Table distributions
+
+ {tables.map((table) => (
+
+ ))}
+
+
+
+ )
+
+}
\ No newline at end of file