import PropTypes from 'prop-types';
import cx from "../../../../utils/css/cx.js";
import classes from './styles.module.scss';
const cls = cx.merge(classes);
const Row = function Row(props) {
  const {
    node,
    components,
    LayoutNode
  } = props;
  const {
    fullWidth,
    reverseMobile,
    nodes = []
  } = node;
  const children = nodes.map(childNode => <LayoutNode key={childNode.id} node={childNode} components={components} />);
  return <div className={cls('row', {
    fullWidth
  })}>
      <div className={cls({
      contents: !fullWidth,
      reverseMobile
    })}>
        {children}
      </div>
    </div>;
};
Row.defaultProps = {
  components: undefined
};
Row.propTypes = {
  node: PropTypes.shape({
    fullWidth: PropTypes.bool,
    reverseMobile: PropTypes.bool,
    nodes: PropTypes.arrayOf(PropTypes.shape({
      id: PropTypes.string.isRequired
    }))
  }).isRequired,
  components: PropTypes.shape({}),
  LayoutNode: PropTypes.elementType.isRequired
};
export default Row;