mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-22 15:46:01 +00:00
free table infrastructure
This commit is contained in:
15
packages/web/src/freetable/useNewFreeTable.js
Normal file
15
packages/web/src/freetable/useNewFreeTable.js
Normal file
@@ -0,0 +1,15 @@
|
||||
import _ from 'lodash';
|
||||
import { useSetOpenedTabs, useCurrentDatabase } from '../utility/globalState';
|
||||
import { openNewTab } from '../utility/common';
|
||||
|
||||
export default function useNewFreeTable() {
|
||||
const setOpenedTabs = useSetOpenedTabs();
|
||||
|
||||
return ({ title = undefined, ...props } = {}) =>
|
||||
openNewTab(setOpenedTabs, {
|
||||
title: title || 'Table',
|
||||
icon: 'freetable.svg',
|
||||
tabComponent: 'FreeTableTab',
|
||||
props: {},
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user