summaryrefslogtreecommitdiffstats
path: root/webapp/components/post_view/post_attachment_list.jsx
diff options
context:
space:
mode:
Diffstat (limited to 'webapp/components/post_view/post_attachment_list.jsx')
-rw-r--r--webapp/components/post_view/post_attachment_list.jsx35
1 files changed, 35 insertions, 0 deletions
diff --git a/webapp/components/post_view/post_attachment_list.jsx b/webapp/components/post_view/post_attachment_list.jsx
new file mode 100644
index 000000000..cfd2f81f8
--- /dev/null
+++ b/webapp/components/post_view/post_attachment_list.jsx
@@ -0,0 +1,35 @@
+// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
+// See License.txt for license information.
+
+import PostAttachment from './post_attachment.jsx';
+
+import React from 'react';
+import PropTypes from 'prop-types';
+
+export default class PostAttachmentList extends React.PureComponent {
+ static propTypes = {
+
+ /**
+ * Array of attachments to render
+ */
+ attachments: PropTypes.array.isRequired
+ }
+
+ render() {
+ const content = [];
+ this.props.attachments.forEach((attachment, i) => {
+ content.push(
+ <PostAttachment
+ attachment={attachment}
+ key={'att_' + i}
+ />
+ );
+ });
+
+ return (
+ <div className='attachment_list'>
+ {content}
+ </div>
+ );
+ }
+}