diff --git a/app/[slug]/dashboard/tables/page.tsx b/app/[slug]/dashboard/tables/page.tsx index 9890735..3f55aa0 100644 --- a/app/[slug]/dashboard/tables/page.tsx +++ b/app/[slug]/dashboard/tables/page.tsx @@ -2,15 +2,28 @@ 'use client'; +import { AbstractApi } from '@/app/api/abstract-api'; +import { TableSimulation, TableSimulationSerializer } from '@/app/lib/tableSimulation'; import Arrangement from '@/app/ui/arrangements/arrangement'; -import React, { useState } from 'react'; import ArrangementsTable from '@/app/ui/arrangements/arrangements-table'; +import { classNames } from '@/app/ui/components/button'; +import { useState } from 'react'; export default function Page() { const [currentArrangement, setCurrentArrangement] = useState(null); + function createSimulation() { + const api = new AbstractApi(); + const serializer = new TableSimulationSerializer(); + api.create(serializer, new TableSimulation(), () => {}); + } + return ( <> +
+ +
+ {currentArrangement && } diff --git a/app/lib/tableSimulation.tsx b/app/lib/tableSimulation.tsx index 9e276a4..7a01b4d 100644 --- a/app/lib/tableSimulation.tsx +++ b/app/lib/tableSimulation.tsx @@ -19,12 +19,12 @@ export type Table = { } export class TableSimulation implements Entity { - id: string; + id?: string; tables: Table[]; - constructor(id: string, tables: Table[]) { + constructor(id?: string, tables?: Table[]) { this.id = id; - this.tables = tables; + this.tables = tables || []; } }