import React from 'react';
import getPaginationLink from 'helpers/getPaginationLink';

const Pagination = ({
  limit,
  totalCount,
  showingCount,
  currentPage,
  totalPages,
  nextPage,
  prevPage,
  isFirstPage,
  isLastPage,
  currentQuery
}) => (
  <nav>
    Showing page {currentPage} of {totalPages}
    {totalPages > 1 &&
      <ul>
        {!isFirstPage &&
          <li>
            <a href={getPaginationLink(prevPage, currentQuery)}>
              Prev page
            </a>
          </li>
        }
        {!isLastPage &&
          <li>
            <a href={getPaginationLink(nextPage, currentQuery)}>
              Next page
            </a>
          </li>
        }
      </ul>
    }
  </nav>
);

export default Pagination;

import React from 'react';
import getPaginationLink from 'helpers/getPaginationLink';

const Pagination = ({
  limit,
  totalCount,
  showingCount,
  currentPage,
  totalPages,
  nextPage,
  prevPage,
  isFirstPage,
  isLastPage,
  currentQuery
}) => (
  <nav role='navigation' itemScope itemType='http://schema.org/SiteNavigationElement'>
    <span>Showing page {currentPage} of {totalPages}</span>
    {totalPages > 1 &&
      <ul>
        {!isFirstPage &&
          <li itemProp='url'>
            <a rel='prev' href={getPaginationLink(prevPage, currentQuery)} itemProp='name'>
              Prev page
            </a>
          </li>
        }
        {!isLastPage &&
          <li itemProp='url'>
            <a rel='next' href={getPaginationLink(nextPage, currentQuery)} itemProp='name'>
              Next page
            </a>
          </li>
        }
      </ul>
    }
  </nav>
);

export default Pagination;

Add pagination metadata for schema.org
Add pagination metadata for schema.org
