UNPKG

gitdocs

Version:

Easy to use, SEO-friendly, beautiful documentation that lives in your git repo.

30 lines (25 loc) 496 B
import React from 'react' import PropTypes from 'prop-types' import { Wrapper, FolderItem } from './styles' const Toc = (props) => { return ( <Wrapper> {props.items.map(item => ( <FolderItem key={`toc-${item.url}`} to={item.url} > <b>{item.title}</b> {item.description} </FolderItem> ))} </Wrapper> ) } Toc.defaultProps = { items: [], } Toc.propTypes = { items: PropTypes.array, } export default Toc