import React, {Component, Fragment} from 'react'; import {string, array} from 'prop-types'; import {slugify, getShortModuleName} from '../../utils/doc'; import Func from './Func'; import Class from './Class'; class Module extends Component { static propTypes = { name: string.isRequired, classes: array.isRequired, functions: array.isRequired }; renderClasses() { if (this.props.classes.length === 0) { return null; } return (

Classes

{this.props.classes.map(cls => )}
); } renderFuncs() { if (this.props.functions.length === 0) { return null; } return (

Functions

{this.props.functions.map(func => )}
); } render() { const name = this.props.name; const slug = slugify(name); return (

{getShortModuleName(name)}

{this.renderClasses()} {this.renderFuncs()}
); } } export default Module;