mirror of
https://github.com/chartdb/chartdb.git
synced 2025-11-13 10:25:58 +00:00
edit table from canvas
This commit is contained in:
18
src/context/layout-context/layout-context.tsx
Normal file
18
src/context/layout-context/layout-context.tsx
Normal file
@@ -0,0 +1,18 @@
|
||||
import { emptyFn } from '@/lib/utils';
|
||||
import { createContext } from 'react';
|
||||
|
||||
export type SidebarSection = 'tables' | 'relationships';
|
||||
|
||||
export interface LayoutContext {
|
||||
openedTableInSidebar: string | undefined;
|
||||
openTableFromSidebar: (tableId: string) => void;
|
||||
selectedSidebarSection: SidebarSection;
|
||||
selectSidebarSection: (section: SidebarSection) => void;
|
||||
}
|
||||
|
||||
export const layoutContext = createContext<LayoutContext>({
|
||||
openedTableInSidebar: undefined,
|
||||
selectedSidebarSection: 'tables',
|
||||
selectSidebarSection: emptyFn,
|
||||
openTableFromSidebar: emptyFn,
|
||||
});
|
||||
Reference in New Issue
Block a user