import React from 'react'; import { DocumentListEntry } from './DocumentListEntry'; import { ImageThumbnail } from './ImageThumbnail'; import { Message } from './propTypes/Message'; import { missingCaseError } from '../../../missingCaseError'; const styles = { container: { width: '100%', }, header: { }, itemContainer: { display: 'flex', flexDirection: 'row', flexWrap: 'wrap', justifyContent: 'flex-start', alignItems: 'flex-start', } as React.CSSProperties, }; interface Props { i18n: (value: string) => string; header?: string; type: 'media' | 'documents'; messages: Array; } export class AttachmentListSection extends React.Component { public renderItems() { const { i18n, messages, type } = this.props; return messages.map((message) => { const { attachments } = message; const firstAttachment = attachments[0]; switch (type) { case 'media': return ( ); case 'documents': return ( ); default: return missingCaseError(type); } }); } public render() { const { header } = this.props; return (
{header}
{this.renderItems()}
); } }