clientjs/packages/dashboard-components/src/ui/AnnotationsDocumentsTable.jsx
changeset 0 5f4fcbc80b37
equal deleted inserted replaced
-1:000000000000 0:5f4fcbc80b37
       
     1 import React from 'react';
       
     2 import { FormattedMessage } from 'react-intl';
       
     3 import PropTypes from 'prop-types';
       
     4 
       
     5 import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
       
     6 
       
     7 import AnnotationsDocumentsTableRow from './AnnotationsDocumentsTableRow';
       
     8 
       
     9 const AnnotationsDocumentsTable = ({
       
    10   documents,
       
    11   viaBaseUrl,
       
    12   topics,
       
    13   metacategories,
       
    14 }) => (
       
    15   <table className="table w-100">
       
    16     <thead>
       
    17       <tr>
       
    18         <th><FormattedMessage id="ui.annotations-documents-table.col.update" defaultMessage="upd." /></th>
       
    19         <th><FormattedMessage id="ui.annotations-documents-table.col.document" defaultMessage="document" /></th>
       
    20         <th><FontAwesomeIcon icon="user" /></th>
       
    21         <th><FontAwesomeIcon icon="pencil-alt" /></th>
       
    22         <th><FormattedMessage id="ui.annotations-documents-table.col.h" defaultMessage="h" /></th>
       
    23       </tr>
       
    24     </thead>
       
    25     <tbody>
       
    26       {
       
    27         documents.map(document => (
       
    28           <AnnotationsDocumentsTableRow
       
    29             key={document.uri}
       
    30             document={document}
       
    31             viaBaseUrl={viaBaseUrl}
       
    32             topics={topics}
       
    33             metacategories={metacategories}
       
    34           />
       
    35         ))
       
    36       }
       
    37     </tbody>
       
    38   </table>
       
    39 );
       
    40 
       
    41 AnnotationsDocumentsTable.propTypes = {
       
    42   documents: PropTypes.arrayOf(PropTypes.object).isRequired,
       
    43   metacategories: PropTypes.arrayOf(PropTypes.object).isRequired,
       
    44   topics: PropTypes.arrayOf(PropTypes.string).isRequired,
       
    45   viaBaseUrl: PropTypes.string.isRequired,
       
    46 };
       
    47 
       
    48 export default AnnotationsDocumentsTable;