Sha256: 99333889a2de54b4d8eb9474bf5664a7590e21a1a9dd6970086e7b1d763e50a1

Contents?: true

Size: 1.15 KB

Versions: 20

Compression:

Stored size: 1.15 KB

Contents

import React from 'react';
import PropTypes from 'prop-types';
import { translate as __ } from 'foremanReact/common/I18n';

import { Table } from '../../move_to_foreman/components/common/table';
import { LoadingState } from '../../move_to_pf/LoadingState';

const ContentTable = ({ content, tableSchema, onPaginationChange }) => {
  const {
    loading, results, pagination, itemCount,
  } = content;

  const emptyStateData = {
    header: __('No Content found'),
  };

  return (
    <LoadingState
      loading={!results || loading}
      loadingText={__('Loading')}
    >
      <Table
        columns={tableSchema}
        rows={results}
        pagination={pagination}
        onPaginationChange={onPaginationChange}
        itemCount={itemCount}
        emptyState={emptyStateData}
      />
    </LoadingState>
  );
};

ContentTable.propTypes = {
  content: PropTypes.shape({
    loading: PropTypes.bool,
    results: PropTypes.array,
    pagination: PropTypes.shape({}),
    itemCount: PropTypes.number,
  }).isRequired,
  onPaginationChange: PropTypes.func.isRequired,
  tableSchema: PropTypes.arrayOf(PropTypes.shape({})).isRequired,
};


export default ContentTable;

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
katello-3.16.0.rc3.1 webpack/components/Content/ContentTable.js
katello-3.15.2 webpack/components/Content/ContentTable.js
katello-3.16.0.rc3 webpack/components/Content/ContentTable.js
katello-3.16.0.rc2.1 webpack/components/Content/ContentTable.js
katello-3.16.0.rc2 webpack/components/Content/ContentTable.js
katello-3.15.1.1 webpack/components/Content/ContentTable.js
katello-3.16.0.rc1.1 webpack/components/Content/ContentTable.js
katello-3.15.1 webpack/components/Content/ContentTable.js
katello-3.16.0.rc1 webpack/components/Content/ContentTable.js
katello-3.15.0.1 webpack/components/Content/ContentTable.js
katello-3.15.0 webpack/components/Content/ContentTable.js
katello-3.15.0.rc2 webpack/components/Content/ContentTable.js
katello-3.15.0.rc1.3 webpack/components/Content/ContentTable.js
katello-3.15.0.rc1.2 webpack/components/Content/ContentTable.js
katello-3.15.0.rc1.1 webpack/components/Content/ContentTable.js
katello-3.15.0.rc1 webpack/components/Content/ContentTable.js
katello-3.14.1 webpack/components/Content/ContentTable.js
katello-3.14.0 webpack/components/Content/ContentTable.js
katello-3.14.0.rc2 webpack/components/Content/ContentTable.js
katello-3.14.0.rc1 webpack/components/Content/ContentTable.js