/* Copyright (C) 2024-2025 LibreWeddingPlanner contributors*/
import { Guest } from "@/app/lib/guest";
import { Table as TableType } from "@/app/lib/tableSimulation";
import { RectangleGroupIcon, UserGroupIcon } from "@heroicons/react/24/outline";
import { v4 as uuidv4 } from 'uuid';
import { Tooltip } from "primereact/tooltip";
import clsx from "clsx";
function Dish({ guest, rotation }: { guest: Guest, rotation?: number }) {
rotation = rotation || 0
return (
{guest.name}
)
}
function GuestRow({ guests }: { guests: Guest[] }) {
return (
{guests.map((guest) => )}
)
}
function RectangularTable({ table }: { table: TableType }) {
const guests = table.guests;
const halfwayThrough = Math.floor(guests.length / 2)
const arrayFirstHalf = guests.slice(0, halfwayThrough);
const arraySecondHalf = guests.slice(halfwayThrough, guests.length);
return (
)
}
function RoundedTable({ table }: { table: TableType }) {
const guests = table.guests;
const size = 500
const rotation = 360 / guests.length
const className = (penalty: number) => {
return clsx("px-2 tooltip-cohesion", {
"hidden": penalty === 0,
"text-orange-300": penalty <= 5,
"text-orange-500": penalty > 5 && penalty <= 10,
"text-orange-700": penalty > 10,
})
}
return (
{
guests.map((guest, index) => {
return (
)
})
}
{`Table #${table.number}`}
)
}
export function Table({ table, style }: { table: TableType, style: "rectangular" | "rounded" }) {
return (
<>
{style === "rectangular" && }
{style === "rounded" && }
>
)
}