{"size": 822, "ext": "js", "max_stars_repo_path": "src/native/app/Page.js", "max_stars_repo_name": "matejkriz/svojsikac", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/native/app/Page.js", "max_issues_repo_name": "matejkriz/svojsikac", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/native/app/Page.js", "max_forks_repo_name": "matejkriz/svojsikac", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 23.4857142857, "max_line_length": 69, "alphanum_fraction": 0.6350364964}
// @flow
import Header from './Header';
import React from 'react';
import linksMessages from '../../common/linksMessages';
import { Container } from './components';
import { Match } from 'react-router';
import { injectIntl, intlShape } from 'react-intl';

const titles = {
  '/': linksMessages.home,
};

const Page = ({ component: Component, intl, pattern, ...props }) => (
  <Match
    {...props}
    pattern={pattern}
    render={renderProps => (
      <Container>
        {titles[pattern] &&
          <Header title={intl.formatMessage(titles[pattern])} />
        }
        <Component {...renderProps} />
      </Container>
    )}
  />
);

Page.propTypes = {
  component: React.PropTypes.func.isRequired,
  intl: intlShape.isRequired,
  pattern: React.PropTypes.string.isRequired,
};

export default injectIntl(Page);
