{"size": 1467, "ext": "js", "max_stars_repo_path": "src/components/Pages/News/NewsList.js", "max_stars_repo_name": "cityofaustin/janis", "max_stars_repo_stars_event_min_datetime": "2018-02-09T16:22:31.000Z", "max_stars_repo_stars_event_max_datetime": "2022-02-16T10:24:58.000Z", "max_issues_repo_path": "src/components/Pages/News/NewsList.js", "max_issues_repo_name": "cityofaustin/janis", "max_issues_repo_issues_event_min_datetime": "2017-11-16T23:17:39.000Z", "max_issues_repo_issues_event_max_datetime": "2022-02-26T09:54:39.000Z", "max_forks_repo_path": "src/components/Pages/News/NewsList.js", "max_forks_repo_name": "cityofaustin/janis", "max_forks_repo_forks_event_min_datetime": "2018-01-10T01:44:28.000Z", "max_forks_repo_forks_event_max_datetime": "2021-09-17T09:10:45.000Z"}
{"max_stars_count": 16, "max_issues_count": 247, "max_forks_count": 11, "avg_line_length": 28.7647058824, "max_line_length": 86, "alphanum_fraction": 0.6428084526}
import React from 'react';
import { useRouteData, Head } from 'react-static';
import { useIntl } from 'react-intl';
import { news as i18n } from 'js/i18n/definitions';
import PageHeader from 'components/PageHeader';

import ContextualNav from 'components/PageSections/ContextualNav';
import PaginationStatic from 'components/PageSections/Pagination/PaginationStatic.js';
import UserFeedback from 'components/UserFeedback';

const NewsListItem = ({ page }) => {
  const intl = useIntl();

  return (
    <>
      <div className="coa-NewsListPage__news-date">{page.newsDate}</div>
      <div className="coa-NewsListPage__news-link">
        <a href={`/${intl.locale}${page.url}`}>{page.title}</a>
      </div>
    </>
  );
};

const NewsListPage = ({ newsListPage }) => {
  const intl = useIntl();
  const { newsList, parent } = newsListPage ? newsListPage : useRouteData();

  return (
    <div>
      <Head>
        <title>{intl.formatMessage(i18n.news)}</title>
      </Head>
      <ContextualNav parent={parent} />
      <PageHeader contentType={'news-list'}>
        {intl.formatMessage(i18n.news)}
      </PageHeader>
      <div className="coa-Page__all-of-the-content">
        <div className="coa-Page__main-content coa-NewsPage__main-content">
          <PaginationStatic
            pagesArray={newsList}
            PageComponent={NewsListItem}
          />
        </div>
      </div>
      <UserFeedback />
    </div>
  );
};

export default NewsListPage;
