import React from 'react';
import './style.less';

import { decamelize } from '../../common';

class DemoSection extends React.Component {
  get demoName() {
    const meta = { name: 'Lazyload', lang: 'zh-CN' } || {};
    if (meta && meta.name) {
      return `demo-${decamelize(meta.name)}`;
    }

    return '';
  }

  render() {
    const { children } = this.props;
    return (
      <section className='wgoo-doc-demo-section' className={this.demoName}>
        {children}
      </section>
    );
  }
}

export default DemoSection;
