import React from 'react'; import { PropTypes } from 'prop-types'; import './style.scss'; const WordCloud = props => (

{ (props.index + 1).toString().padStart(3, '0') }

{ props.words.title }

{ props.words.cloud.map(word => ( { word.url ? ({ word.word }) : { word.word } } )) }
); WordCloud.propTypes = { index: PropTypes.number.isRequired, words: PropTypes.shape({ title: PropTypes.string, cloud: PropTypes.array, }).isRequired, }; export default WordCloud;