import React from 'react'; import PropTypes from 'prop-types'; import Subsection from './Subsection'; export default function Chapter({ chapter, }) { if (chapter.displayName === 'hidden') { return null; } const { subsections } = chapter; return (
{chapter.displayName}
{subsections.map((subsection) => ( ))}
); } Chapter.propTypes = { chapter: PropTypes.shape({ displayName: PropTypes.string, subsections: PropTypes.arrayOf(PropTypes.shape({ url: PropTypes.string, })), }).isRequired, };