import React from 'react'
import { getChildren } from 'jsonml.js/lib/utils'
import Base from './Base'

export default class Changelog extends Base {
  static collector = (nextProps) => {
    return nextProps.data.CHANGELOG()
  }
  render () {
    const { utils, content, description } = this.props
    return (
      <div className='main-wrapper'>
        <div className='main-container main-container-component'>
          <article className='markdown'>
            {!description
              ? null
              : utils.toReactComponent(['section', { className: 'markdown' }].concat(getChildren(description)))}
            {utils.toReactComponent(['section', { className: 'markdown' }].concat(getChildren(content)))}
          </article>
        </div>
      </div>
    )
  }
}
