mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-19 14:16:01 +00:00
execute designed query
This commit is contained in:
@@ -62,7 +62,7 @@ export function TabPage({ key, label, children }) {
|
||||
return children;
|
||||
}
|
||||
|
||||
export function TabControl({ children, activePageIndex = undefined }) {
|
||||
export function TabControl({ children, activePageIndex = undefined, activePageLabel = undefined }) {
|
||||
const [value, setValue] = React.useState(0);
|
||||
|
||||
// const [mountedTabs, setMountedTabs] = React.useState({});
|
||||
@@ -73,6 +73,13 @@ export function TabControl({ children, activePageIndex = undefined }) {
|
||||
if (activePageIndex != null) setValue(activePageIndex);
|
||||
}, [activePageIndex]);
|
||||
|
||||
React.useEffect(() => {
|
||||
if (activePageLabel != null) {
|
||||
const pageIndex = _.findIndex(childrenArray, (x) => x.props.label == activePageLabel);
|
||||
if (pageIndex >= 0) setValue(pageIndex);
|
||||
}
|
||||
}, [activePageLabel]);
|
||||
|
||||
const theme = useTheme();
|
||||
|
||||
// // cleanup closed tabs
|
||||
|
||||
Reference in New Issue
Block a user