import { AxiosError } from 'axios'; import classNames from 'clsx'; import React, { MutableRefObject, useEffect, useState } from 'react'; import { defineMessages, useIntl } from 'react-intl'; import { Stack } from 'soapbox/components/ui'; // import UploadProgress from 'soapbox/components/upload-progress'; // import UploadButton from 'soapbox/features/compose/components/upload_button'; import { IChat, useChatActions } from 'soapbox/queries/chats'; // import { truncateFilename } from 'soapbox/utils/media'; import ChatComposer from './chat-composer'; import ChatMessageList from './chat-message-list'; // const fileKeyGen = (): number => Math.floor((Math.random() * 0x10000)); const messages = defineMessages({ failedToSend: { id: 'chat.failed_to_send', defaultMessage: 'Message failed to send.' }, }); interface ChatInterface { chat: IChat, inputRef?: MutableRefObject, className?: string, } /** * Clears the value of the input while dispatching the `onChange` function * which allows the