@wulperstudio/cms
Version:
Wulper Studio Library Components CMS
52 lines • 1.99 kB
JavaScript
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
var _excluded = ["firstBox", "secondBox", "firstBoxProps", "secondBoxProps", "isOneBox"],
_excluded2 = ["sx", "maxWidth", "component"];
import React from 'react';
import { Box, Container, useTheme } from '@mui/material';
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
export var ContentRowBlock = function ContentRowBlock(_ref) {
var firstBox = _ref.firstBox,
secondBox = _ref.secondBox,
firstBoxProps = _ref.firstBoxProps,
secondBoxProps = _ref.secondBoxProps,
isOneBox = _ref.isOneBox,
props = _objectWithoutProperties(_ref, _excluded);
var theme = useTheme();
var sx = props.sx,
_props$maxWidth = props.maxWidth,
maxWidth = _props$maxWidth === void 0 ? 'xl' : _props$maxWidth,
_props$component = props.component,
component = _props$component === void 0 ? 'section' : _props$component,
rest = _objectWithoutProperties(props, _excluded2);
return /*#__PURE__*/_jsx(Container, Object.assign({
component: component,
maxWidth: maxWidth,
sx: Object.assign({
display: 'grid',
gridTemplateColumns: 'repeat(2, 1fr)',
gap: '20px'
}, isOneBox && {
gridTemplateColumns: 'unset',
placeItems: 'center'
}, _defineProperty({}, theme.breakpoints.down('md'), {
gridTemplateColumns: '1fr'
}), sx)
}, rest, {
children: isOneBox ? /*#__PURE__*/_jsx(Box, Object.assign({
component: "article"
}, firstBoxProps, {
children: firstBox
})) : /*#__PURE__*/_jsxs(_Fragment, {
children: [/*#__PURE__*/_jsx(Box, Object.assign({
component: "article"
}, firstBoxProps, {
children: firstBox
})), /*#__PURE__*/_jsx(Box, Object.assign({
component: "article"
}, secondBoxProps, {
children: secondBox
}))]
})
}));
};