UNPKG

@massds/mayflower-react

Version:

React versions of Mayflower design system UI components

21 lines (19 loc) 796 B
/** * TableofContents module. * @module @massds/mayflower-react/TableofContents * @requires module:@massds/mayflower-assets/scss/03-organisms/table-of-contents-hierarchy */ import React from "react"; import PropTypes from "prop-types"; const TableofContents = props => /*#__PURE__*/React.createElement("nav", { className: "ma__toc--hierarchy" }, props.heading, /*#__PURE__*/React.createElement("ul", { className: "ma__toc--hierarchy__container" }, // eslint-disable-next-line react/prop-types React.Children.map(props.children, child => /*#__PURE__*/React.createElement("li", null, child)))); TableofContents.propTypes = process.env.NODE_ENV !== "production" ? { /** The heading text */ heading: PropTypes.element, children: PropTypes.node } : {}; export default TableofContents;