Sha256: 477f07e4982d7dc229149893e68a79cf03ea2321b5ced075619e6fc0f6c631fa

Contents?: true

Size: 912 Bytes

Versions: 122

Compression:

Stored size: 912 Bytes

Contents

import React from 'react';
import PropTypes from 'prop-types';
import { Table } from 'react-bootstrap';

// using Map to preserve order

const createRows = (details, mapping) => {
  const rows = [];
  /* eslint-disable no-restricted-syntax, react/jsx-closing-tag-location */
  for (const key of mapping.keys()) {
    rows.push(<tr key={key}>
      <td><b>{mapping.get(key)}</b></td>
      <td>{Array.isArray(details[key]) ? details[key].join(', ') : details[key]}</td>
    </tr>);
  }
  /* eslint-enable no-restricted-syntax, react/jsx-closing-tag-location */
  return rows;
};

const ContentDetailInfo = ({ contentDetails, displayMap }) => (
  <Table>
    <tbody>
      {createRows(contentDetails, displayMap)}
    </tbody>
  </Table>
);

ContentDetailInfo.propTypes = {
  contentDetails: PropTypes.shape({}).isRequired,
  displayMap: PropTypes.instanceOf(Map).isRequired,
};

export default ContentDetailInfo;

Version data entries

122 entries across 122 versions & 1 rubygems

Version Path
katello-4.8.4 webpack/components/Content/Details/ContentDetailInfo.js
katello-4.8.3 webpack/components/Content/Details/ContentDetailInfo.js
katello-4.7.6 webpack/components/Content/Details/ContentDetailInfo.js
katello-4.8.2 webpack/components/Content/Details/ContentDetailInfo.js
katello-4.8.1 webpack/components/Content/Details/ContentDetailInfo.js
katello-4.7.5 webpack/components/Content/Details/ContentDetailInfo.js
katello-4.8.0 webpack/components/Content/Details/ContentDetailInfo.js
katello-4.8.0.rc2 webpack/components/Content/Details/ContentDetailInfo.js
katello-4.7.4 webpack/components/Content/Details/ContentDetailInfo.js
katello-4.8.0.rc1 webpack/components/Content/Details/ContentDetailInfo.js
katello-4.7.3 webpack/components/Content/Details/ContentDetailInfo.js
katello-4.7.2 webpack/components/Content/Details/ContentDetailInfo.js
katello-4.7.1 webpack/components/Content/Details/ContentDetailInfo.js
katello-4.6.2.1 webpack/components/Content/Details/ContentDetailInfo.js
katello-4.6.2 webpack/components/Content/Details/ContentDetailInfo.js
katello-4.7.0 webpack/components/Content/Details/ContentDetailInfo.js
katello-4.6.1 webpack/components/Content/Details/ContentDetailInfo.js
katello-4.7.0.rc2 webpack/components/Content/Details/ContentDetailInfo.js
katello-4.7.0.rc1 webpack/components/Content/Details/ContentDetailInfo.js
katello-4.4.2.2 webpack/components/Content/Details/ContentDetailInfo.js