@shopgate/engage
Version:
Shopgate's ENGAGE library.
28 lines (27 loc) • 1.05 kB
JavaScript
import React from 'react';
import PropTypes from 'prop-types';
import { getSubgroupsFromProperties } from "./helpers/getSubgroupsFromProperties";
import { getPropertiesWithoutSubgroup } from "./helpers/getPropertiesWithoutSubgroup";
import { getPropertiesBySubgroup } from "./helpers/getPropertiesBySubgroup";
import Group from "./Group";
import Rows from "./Rows";
/**
* Renders lists of properties that are eventually grouped.
* @param {Object} props The component props.
* @return {JSX}
*/
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
const Lists = ({
properties
}) => /*#__PURE__*/_jsxs(_Fragment, {
children: [/*#__PURE__*/_jsx(Rows, {
properties: getPropertiesWithoutSubgroup(properties)
}), getSubgroupsFromProperties(properties).map(group => /*#__PURE__*/_jsxs(React.Fragment, {
children: [/*#__PURE__*/_jsx(Group, {
group: group
}), /*#__PURE__*/_jsx(Rows, {
properties: getPropertiesBySubgroup(properties, group)
})]
}, group))]
});
export default Lists;