import React from 'react'; import { ProgressBar, Textarea } from 'soapbox/components/ui'; import { Attachment } from 'soapbox/types/entities'; 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 => ( ))}
)}