Sha256: b0306c6dc95dbc7782e17796ca231f6ac719c146e800af33e0d4546837caabd3

Contents?: true

Size: 1.19 KB

Versions: 1

Compression:

Stored size: 1.19 KB

Contents

import React, { useState } from 'react';
import { ListView } from 'patternfly-react';
import PropTypes from 'prop-types';

import Pagination from 'foremanReact/components/Pagination/PaginationWrapper';
import { useForemanSettings } from 'foremanReact/Root/Context/ForemanContext';

import PreupgradeReportEntry from './components/PreupgradeReportEntry';
import { entriesPage } from '../PreupgradeReports/PreupgradeReportsHelpers';

const PreupgradeReportsList = ({ allEntries }) => {
  const { perPage, perPageOptions } = useForemanSettings();
  const [pagination, setPagination] = useState({
    page: 1,
    perPage,
    perPageOptions,
  });

  return (
    <ListView>
      {entriesPage(allEntries, pagination).map((entry, idx) => (
        <PreupgradeReportEntry entry={entry} key={idx} />
      ))}
      <Pagination
        viewType="list"
        itemCount={allEntries.length}
        pagination={pagination}
        onChange={newPage => setPagination({ ...pagination, ...newPage })}
        dropdownButtonId="preupgrade-report-entries-pagination-dropdown"
      />
    </ListView>
  );
};

PreupgradeReportsList.propTypes = {
  allEntries: PropTypes.array.isRequired,
};

export default PreupgradeReportsList;

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
foreman_leapp-0.0.6 webpack/components/PreupgradeReportsList/index.js