import React from 'react'; import { PhotosSettingsProps } from './props'; import { styles } from './styles'; import { Image } from '../../../Components/Image'; import { Dropdown } from '../../../Components/Dropdown'; import { AttachmentObject } from '../../../../interfaces'; import { isImage, getFileName } from '../../../util/file'; export const PhotosSettings: React.FC = ( props: PhotosSettingsProps ) => { const { chat = { attachments: [] } } = props; const renderImages = (attachments: Array) => { return attachments.map((attachment, index) => { const fileName = getFileName(attachment.file); if (isImage(fileName)) { return (
); } return ; }); }; if (props.renderPhotosSettings) { return <>{props.renderPhotosSettings(props)}; } return ( {renderImages(chat.attachments)} ); };