import React from 'react'; import { Textarea } from 'soapbox/components/ui'; import { Attachment } from 'soapbox/types/entities'; import ChatPendingUpload from './chat-pending-upload'; import ChatUpload from './chat-upload'; interface IChatTextarea extends React.ComponentProps { attachments?: Attachment[] onDeleteAttachment?: () => void isUploading?: boolean uploadProgress?: number } /** Custom textarea for chats. */ const ChatTextarea: React.FC = ({ attachments, onDeleteAttachment, isUploading = false, uploadProgress = 0, ...rest }) => { return (
{(!!attachments?.length || isUploading) && (
{isUploading && ( )} {attachments?.map(attachment => ( ))}
)}