diff --git a/ts/components/conversation/StagedGenericAttachment.tsx b/ts/components/conversation/StagedGenericAttachment.tsx index 8749d395f..52d9d6ec0 100644 --- a/ts/components/conversation/StagedGenericAttachment.tsx +++ b/ts/components/conversation/StagedGenericAttachment.tsx @@ -1,35 +1,32 @@ -import { Component } from 'react'; import { AttachmentType, getExtensionForDisplay } from '../../types/Attachment'; -interface Props { +type Props = { attachment: AttachmentType; onClose: (attachment: AttachmentType) => void; -} +}; -export class StagedGenericAttachment extends Component { - public render() { - const { attachment, onClose } = this.props; - const { fileName, contentType } = attachment; - const extension = getExtensionForDisplay({ contentType, fileName }); +export function StagedGenericAttachment(props: Props) { + const { attachment, onClose } = props; + const { fileName, contentType } = attachment; + const extension = getExtensionForDisplay({ contentType, fileName }); - return ( -
-
{ - if (onClose) { - onClose(attachment); - } - }} - /> -
- {extension ? ( -
{extension}
- ) : null} -
-
{fileName}
+ return ( +
+
{ + if (onClose) { + onClose(attachment); + } + }} + /> +
+ {extension ? ( +
{extension}
+ ) : null}
- ); - } +
{fileName}
+
+ ); }