content: // @flow
  
  import React from 'react';
  import { Grid, Row, Col, Nav, NavItem } from 'react-bootstrap';
  import { connect } from 'react-redux';
  import _ from 'lodash/core';
  import { IndexLink } from 'react-router';
  
  class FooterContainer extends React.Component {
    render() {
      const { copyright, navigation } = this.props.content;
      const { zsName, tosPage } = this.props;
  
      let footNav, copyrightNode;
  
      if (navigation) {
        // TODO: must integrate this option
        footNav = (
          <Grid fluid={true} className="copyright">
            <Grid></Grid>
          </Grid>
        )
      }
  
      if (copyright) {
        // determine name to display
        let name = `${zsName}.`;
        if (copyright.name) { name = copyright.name; }
  
        copyrightNode = (
          <Grid fluid={true} className="copyright">
            <Grid>
              <Row>
                <Col md={6}>
                  Copyright © {new Date().getFullYear()} {name} All rights reserved.
                </Col>
                <Col md={6} className="legal">
                  {tosPage &&
                    <IndexLink to={tosPage.realPath}>{tosPage.scsName}</IndexLink>
                  }
                </Col>
              </Row>
  
            </Grid>
          </Grid>
        )
      }
  
      return (
        <div className="footer">
          {footNav}
          {copyrightNode}
        </div>
      );
    }
  }
  
  const Footer = connect(
    (state) => {
    return {
      zsName: state.zlSite.zsName,
      tosPage: _.find(state.pages, function(o) {
        return o.scsOptions && 'terms-of-service' === o.scsOptions.UniId;
      })
    }
  }
  )(FooterContainer)
  
  module.exports = Footer;
  