import clsx from 'clsx'; import { List as ImmutableList } from 'immutable'; import React from 'react'; import { openModal } from 'soapbox/actions/modals'; import Blurhash from 'soapbox/components/blurhash'; import { Icon } from 'soapbox/components/ui'; import { useAppDispatch } from 'soapbox/hooks'; import ChatUploadPreview from './chat-upload-preview'; import type { Attachment } from 'soapbox/types/entities'; interface IChatUpload { attachment: Attachment, onDelete?(): void, } /** An attachment uploaded to the chat composer, before sending. */ const ChatUpload: React.FC = ({ attachment, onDelete }) => { const dispatch = useAppDispatch(); const clickable = attachment.type !== 'unknown'; const handleOpenModal = () => { dispatch(openModal('MEDIA', { media: ImmutableList.of(attachment), index: 0 })); }; return (
); }; interface IRemoveButton { onClick?: React.MouseEventHandler } /** Floating button to remove an attachment. */ const RemoveButton: React.FC = ({ onClick }) => { return ( ); }; export default ChatUpload;