Sha256: ee2472278effd1b5ac5a16945498683d99a47669992451b45508ceab0783faae

Contents?: true

Size: 1.14 KB

Versions: 4

Compression:

Stored size: 1.14 KB

Contents

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

import Pagination from 'foremanReact/components/Pagination/PaginationWrapper';

import SyncedTemplate from './SyncedTemplate';
import { templatesPage } from '../TemplateSyncResultHelpers';
import ListViewHeader from './ListViewHeader';

const SyncResultList = ({ pagination, pageChange, templates, editPaths }) => (
  <ListView>
    <ListViewHeader />
    {templatesPage(templates, pagination).map((template, idx) => (
      <SyncedTemplate
        template={template}
        key={idx}
        editPath={editPaths[template.className]}
      />
    ))}
    <Pagination
      viewType="list"
      itemCount={templates.length}
      pagination={pagination}
      onChange={pageChange}
      dropdownButtonId="template-sync-result-dropdown"
    />
  </ListView>
);

SyncResultList.propTypes = {
  pagination: PropTypes.shape({
    page: PropTypes.number,
    perPage: PropTypes.number,
  }).isRequired,
  pageChange: PropTypes.func.isRequired,
  templates: PropTypes.array.isRequired,
  editPaths: PropTypes.object.isRequired,
};

export default SyncResultList;

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
foreman_templates-9.1.0 webpack/components/TemplateSyncResult/components/SyncResultList.js
foreman_templates-9.0.2 webpack/components/TemplateSyncResult/components/SyncResultList.js
foreman_templates-9.0.1 webpack/components/TemplateSyncResult/components/SyncResultList.js
foreman_templates-9.0.0 webpack/components/TemplateSyncResult/components/SyncResultList.js