@talend/react-components
Version:
Set of react components.
51 lines (50 loc) • 1.31 kB
JavaScript
import PropTypes from 'prop-types';
import classnames from 'classnames';
import theme from './OneColumn.module.scss';
import TabBar from '../../TabBar';
import WithDrawer from '../../WithDrawer';
/**
* @param {object} props react props
* @example
<OneColumn name="Hello world"></OneColumn>
*/
import { omit } from "lodash";
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
function OneColumn({
drawers,
children,
tabs,
...props
}) {
const container = classnames('tc-layout-one-column', theme.main);
const style = {
overflow: 'auto',
height: '100%',
display: 'flex',
flexDirection: 'column'
};
return /*#__PURE__*/_jsx("div", {
role: "main",
id: "tc-layout-main",
tabIndex: "-1",
className: container,
...omit(props, 'getComponent'),
children: /*#__PURE__*/_jsxs(WithDrawer, {
drawers: drawers,
children: [tabs && /*#__PURE__*/_jsx(TabBar, {
...tabs
}), /*#__PURE__*/_jsx("div", {
style: style,
children: children
})]
})
});
}
OneColumn.displayName = 'OneColumn';
OneColumn.propTypes = {
children: PropTypes.node,
drawers: PropTypes.arrayOf(PropTypes.node),
tabs: PropTypes.shape(TabBar.propTypes)
};
export default OneColumn;
//# sourceMappingURL=OneColumn.component.js.map