Some checks failed
		
		
	
	Check usage of free licenses / build-static-assets (pull_request) Successful in 58s
				
			Add copyright notice / copyright_notice (pull_request) Successful in 1m19s
				
			Build Nginx-based docker image / build-static-assets (push) Successful in 5m39s
				
			Playwright Tests / test (pull_request) Failing after 9m0s
				
			
		
			
				
	
	
		
			37 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			37 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
| /* Copyright (C) 2024-2025 LibreWeddingPlanner contributors*/
 | |
| 
 | |
| 'use client';
 | |
| 
 | |
| import { AbstractApi } from '@/app/api/abstract-api';
 | |
| import { TableArrangement } from '@/app/lib/definitions';
 | |
| import { TableSimulation, TableSimulationSerializer } from '@/app/lib/tableSimulation';
 | |
| import { Table } from '@/app/ui/components/table';
 | |
| import { lusitana } from '@/app/ui/fonts';
 | |
| import { useState, useEffect } from 'react';
 | |
| 
 | |
| export default function Arrangement({ id }: { id: string }) {
 | |
| 
 | |
|   const [simulation, setSimulation] = useState<TableSimulation | undefined>(undefined);
 | |
| 
 | |
|   function loadSimulation() {
 | |
|     new AbstractApi<TableSimulation>().get(new TableSimulationSerializer(), id, (object: TableSimulation) => {
 | |
|       setSimulation(object);
 | |
|     });
 | |
|   }
 | |
| 
 | |
|   useEffect(loadSimulation, []);
 | |
| 
 | |
|   return (
 | |
|     <div className="w-full">
 | |
|       <div className="w-full items-center justify-between">
 | |
|         <h1 className={`${lusitana.className} text-2xl my-5`}>Table distributions</h1>
 | |
|         <div className="flex flex-row flex-wrap justify-around">
 | |
|           {simulation && simulation.tables.map((table) => (
 | |
|             <Table key={table.number} table={table} style="rounded" />
 | |
|           ))}
 | |
|         </div>
 | |
|       </div>
 | |
|     </div>
 | |
|   )
 | |
| 
 | |
| } |