RocketChat/Rocket.Chat

View on GitHub
apps/meteor/client/components/message/content/Attachments.tsx

Summary

Maintainability
A
0 mins
Test Coverage
import type { MessageAttachmentBase } from '@rocket.chat/core-typings';
import type { ReactElement } from 'react';
import React from 'react';

import AttachmentsItem from './attachments/AttachmentsItem';

type AttachmentsProps = {
    attachments: MessageAttachmentBase[];
    id?: string | undefined;
};

const Attachments = ({ attachments, id }: AttachmentsProps): ReactElement => {
    return (
        <>
            {attachments?.map((attachment, index) => (
                <AttachmentsItem key={index} id={id} attachment={{ ...attachment }} />
            ))}
        </>
    );
};

export default Attachments;