@wulperstudio/cms
Version:
Wulper Studio Library Components CMS
62 lines (61 loc) • 2.53 kB
JavaScript
;
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
var _react = _interopRequireDefault(require("react"));
var _material = require("@mui/material");
var _styled = require("./styled");
var _jsxRuntime = require("react/jsx-runtime");
var _excluded = ["type", "colorTextCustom"];
/* eslint-disable react/no-array-index-key */
var InstructionsOutput = function InstructionsOutput(_ref) {
var _ref$type = _ref.type,
type = _ref$type === void 0 ? 'ordered' : _ref$type,
colorTextCustom = _ref.colorTextCustom,
props = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
var theme = (0, _material.useTheme)();
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Typography, {
fontSize: "14px",
color: theme.palette.text.primary,
children: props.title
}), type === 'ordered' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_styled.OrderedList, {
children: props.instructions.map(function (item, i) {
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_styled.Item, {
children: item
}, i);
})
}), type === 'unordered' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_styled.UnOrderedList, {
children: props.instructions.map(function (item, i) {
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_styled.Item, {
children: item
}, i);
})
}), type === 'simple' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_styled.List, {
children: props.instructions.map(function (item, i) {
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_styled.Item, {
children: item
}, i);
})
}), type === 'custom' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_styled.List, {
children: props.instructions.map(function (item, i) {
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Grid, {
container: true,
columnGap: "10px",
alignItems: "center",
children: [props.iconCustom, /*#__PURE__*/(0, _jsxRuntime.jsx)(_styled.Item, {
style: {
listStyle: 'none',
color: colorTextCustom
},
children: item
})]
}, i);
})
}), props.children]
});
};
var _default = exports["default"] = InstructionsOutput;