mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-19 21:16:00 +00:00
introduced yarn workspace
This commit is contained in:
18
packages/web/src/TabContent.js
Normal file
18
packages/web/src/TabContent.js
Normal file
@@ -0,0 +1,18 @@
|
||||
import React from 'react';
|
||||
import styled from 'styled-components';
|
||||
import theme from './theme';
|
||||
import tabs from './tabs';
|
||||
|
||||
import { useOpenedTabs } from './utility/globalState';
|
||||
|
||||
export default function TabContent() {
|
||||
const files = useOpenedTabs();
|
||||
|
||||
const selectedTab = files.find(x => x.selected);
|
||||
if (!selectedTab) return null;
|
||||
|
||||
const TabComponent = tabs[selectedTab.tabComponent];
|
||||
if (TabComponent) return <TabComponent {...selectedTab.props} />;
|
||||
|
||||
return null;
|
||||
}
|
||||
Reference in New Issue
Block a user