PageAttachmentList.js 651 B

123456789101112131415161718192021222324252627282930
  1. import React from 'react';
  2. import Attachment from './Attachment';
  3. export default class PageAttachmentList extends React.Component {
  4. render() {
  5. if (this.props.attachments <= 0) {
  6. return null;
  7. }
  8. const attachmentList = this.props.attachments.map((attachment, idx) => {
  9. return (
  10. <Attachment
  11. key={"page:attachment:" + attachment._id}
  12. attachment={attachment}
  13. inUse={this.props.inUse[attachment._id] || false}
  14. onAttachmentDeleteClicked={this.props.onAttachmentDeleteClicked}
  15. />
  16. );
  17. });
  18. return (
  19. <ul>
  20. {attachmentList}
  21. </ul>
  22. );
  23. }
  24. }