The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/client/components/Message/Attachments/Attachments.tsx

20 lines
730 B

import React, { FC } from 'react';
import { FileProp } from '../../../../definition/IMessage/MessageAttachment/Files/FileProp';
import { MessageAttachmentBase } from '../../../../definition/IMessage/MessageAttachment/MessageAttachmentBase';
import { useBlockRendered } from '../hooks/useBlockRendered';
import Item from './Item';
const Attachments: FC<{ attachments: Array<MessageAttachmentBase>; file?: FileProp }> = ({ attachments = null, file }): any => {
const { className, ref } = useBlockRendered();
return (
<>
<div className={className} ref={ref as any} />
{attachments?.map((attachment, index) => (
<Item key={index} file={file} attachment={attachment} />
))}
</>
);
};
export default Attachments;