@wulperstudio/cms
Version:
Wulper Studio Library Components CMS
55 lines • 2.03 kB
JavaScript
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
var _excluded = ["type", "colorTextCustom"];
/* eslint-disable react/no-array-index-key */
import React from 'react';
import { Grid, Typography, useTheme } from '@mui/material';
import { Item, OrderedList, UnOrderedList, List } from './styled';
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
var InstructionsOutput = function InstructionsOutput(_ref) {
var _ref$type = _ref.type,
type = _ref$type === void 0 ? 'ordered' : _ref$type,
colorTextCustom = _ref.colorTextCustom,
props = _objectWithoutProperties(_ref, _excluded);
var theme = useTheme();
return /*#__PURE__*/_jsxs("div", {
children: [/*#__PURE__*/_jsx(Typography, {
fontSize: "14px",
color: theme.palette.text.primary,
children: props.title
}), type === 'ordered' && /*#__PURE__*/_jsx(OrderedList, {
children: props.instructions.map(function (item, i) {
return /*#__PURE__*/_jsx(Item, {
children: item
}, i);
})
}), type === 'unordered' && /*#__PURE__*/_jsx(UnOrderedList, {
children: props.instructions.map(function (item, i) {
return /*#__PURE__*/_jsx(Item, {
children: item
}, i);
})
}), type === 'simple' && /*#__PURE__*/_jsx(List, {
children: props.instructions.map(function (item, i) {
return /*#__PURE__*/_jsx(Item, {
children: item
}, i);
})
}), type === 'custom' && /*#__PURE__*/_jsx(List, {
children: props.instructions.map(function (item, i) {
return /*#__PURE__*/_jsxs(Grid, {
container: true,
columnGap: "10px",
alignItems: "center",
children: [props.iconCustom, /*#__PURE__*/_jsx(Item, {
style: {
listStyle: 'none',
color: colorTextCustom
},
children: item
})]
}, i);
})
}), props.children]
});
};
export default InstructionsOutput;