1
/* eslint-disable react/prop-types */
2

3 1
import React from 'react';
4

5 1
import { ADMIN_URLS, STRINGS } from '../../config/wagtailConfig';
6 1
import Icon from '../Icon/Icon';
7

8
interface PageCountProps {
9
  page: {
10
    id: number;
11
    children: {
12
      count: number;
13
    }
14
  }
15
}
16

17 1
const PageCount: React.FunctionComponent<PageCountProps> = ({ page }) => {
18 1
  const count = page.children.count;
19

20 1
  return (
21
    <a
22
      href={`${ADMIN_URLS.PAGES}${page.id}/`}
23
      className="c-explorer__see-more"
24
    >
25
      {STRINGS.SEE_ALL}
26 1
      <span>{` ${count} ${count === 1 ? STRINGS.PAGE.toLowerCase() : STRINGS.PAGES.toLowerCase()}`}</span>
27
      <Icon name="arrow-right" />
28
    </a>
29
  );
30
};
31

32 1
export default PageCount;

Read our documentation on viewing source code .

Loading