mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-19 10:46:00 +00:00
query result shown
This commit is contained in:
30
packages/web/src/widgets/Splitter.js
Normal file
30
packages/web/src/widgets/Splitter.js
Normal file
@@ -0,0 +1,30 @@
|
||||
import _ from 'lodash';
|
||||
import React from 'react';
|
||||
import styled from 'styled-components';
|
||||
|
||||
const MainContainer = styled.div`
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
`;
|
||||
|
||||
const ChildContainer = styled.div`
|
||||
flex: 1;
|
||||
// flex: 0 0 50%;
|
||||
// flex-basis: 100px;
|
||||
// flex-grow: 1;
|
||||
display: flex;
|
||||
position: relative;
|
||||
`;
|
||||
|
||||
export function VerticalSplitter({ children }) {
|
||||
if (!_.isArray(children) || children.length !== 2) {
|
||||
throw new Error('Splitter must have exactly 2 children');
|
||||
}
|
||||
return (
|
||||
<MainContainer>
|
||||
<ChildContainer>{children[0]}</ChildContainer>
|
||||
<ChildContainer>{children[1]}</ChildContainer>
|
||||
</MainContainer>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user