import React, { Component } from 'react';
import { LocaleProvider } from 'antd';
import zhCN from 'antd/lib/locale-provider/zh_CN';
import './app.less';
import Header from './components/Header';

export default class extends Component {
  constructor(props) {
    super(props);
    const state = { routes: [] };
    this.state = state;
  }

  render() {
    const { children, project, config } = this.props;
    return (
      <LocaleProvider locale={zhCN}>
        {config.hideHeader ? (
          <div id="full-page">{children}</div>
        ) : (
          <div className={`${config.tab}`} id="page">
            <Header tabs={project.tabs} active={config.tab} />
            {children}
          </div>
        )}
      </LocaleProvider>
    );
  }
}
