import React from 'react';
import { Link } from 'react-router';
import { Row, Col, Menu } from '../../../';
import * as utils from '../utils';
export default class MainContent extends React.Component {
getMenuItems() {
const props = this.props;
return props.menuItems.map((item) => {
const key = item.english.toLowerCase();
const text = item.chinese || item.english;
const child = !item.link ?
{ text }
:
{ text }
;
return (
{ item.disabled ? {text} : child }
);
});
}
render() {
const activeMenuItem = utils.getActiveMenuItem(this.props);
const menuItems = this.getMenuItems();
const { prev, next } = utils.getFooterNav(menuItems, activeMenuItem);
return (
{ this.props.children }
{ !!prev ? React.cloneElement(prev.props.children, { className: 'prev-page' }) : null }
{ !!next ? React.cloneElement(next.props.children, { className: 'next-page' }) : null }
);
}
}