create tables

This commit is contained in:
Guy Ben-Aharon
2024-08-11 18:15:13 +03:00
parent d4654b1155
commit f496d23ba6
16 changed files with 226 additions and 27 deletions

View File

@@ -0,0 +1,19 @@
import { createContext } from 'react';
import { DBTable } from '@/lib/domain/db-table';
import { emptyFn } from '@/lib/utils';
export interface ChartDBContext {
createTable: () => void;
addTable: (table: DBTable) => void;
removeTable: (id: string) => void;
updateTable: (id: string, table: Partial<DBTable>) => void;
tables: DBTable[];
}
export const chartDBContext = createContext<ChartDBContext>({
createTable: emptyFn,
addTable: emptyFn,
removeTable: emptyFn,
updateTable: emptyFn,
tables: [],
});