mirror of
https://github.com/chartdb/chartdb.git
synced 2025-10-30 11:33:58 +00:00
create tables
This commit is contained in:
19
src/context/chartdb-context/chartdb-context.tsx
Normal file
19
src/context/chartdb-context/chartdb-context.tsx
Normal 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: [],
|
||||
});
|
||||
Reference in New Issue
Block a user