mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-19 16:36:00 +00:00
query fixes
This commit is contained in:
@@ -61,13 +61,17 @@ export function TabPage({ key, label, children }) {
|
||||
return children;
|
||||
}
|
||||
|
||||
export function TabControl({ children }) {
|
||||
export function TabControl({ children, activePageIndex = undefined }) {
|
||||
const [value, setValue] = React.useState(0);
|
||||
|
||||
// const [mountedTabs, setMountedTabs] = React.useState({});
|
||||
|
||||
const childrenArray = (_.isArray(children) ? _.flatten(children) : [children]).filter((x) => x);
|
||||
|
||||
React.useEffect(() => {
|
||||
if (activePageIndex != null) setValue(activePageIndex);
|
||||
}, [activePageIndex]);
|
||||
|
||||
// // cleanup closed tabs
|
||||
// if (_.difference(_.keys(mountedTabs), _.map(childrenArray, 'props.key')).length > 0) {
|
||||
// setMountedTabs(_.pickBy(mountedTabs, (v, k) => childrenArray.find((x) => x.props.key == k)));
|
||||
|
||||
Reference in New Issue
Block a user