feat: converted stagedGenericAttachment to be functional

pull/3056/head
William Grant 2 years ago
parent 7f031681f8
commit d05c3e41eb

@ -1,14 +1,12 @@
import { Component } from 'react';
import { AttachmentType, getExtensionForDisplay } from '../../types/Attachment'; import { AttachmentType, getExtensionForDisplay } from '../../types/Attachment';
interface Props { type Props = {
attachment: AttachmentType; attachment: AttachmentType;
onClose: (attachment: AttachmentType) => void; onClose: (attachment: AttachmentType) => void;
} };
export class StagedGenericAttachment extends Component<Props> { export function StagedGenericAttachment(props: Props) {
public render() { const { attachment, onClose } = props;
const { attachment, onClose } = this.props;
const { fileName, contentType } = attachment; const { fileName, contentType } = attachment;
const extension = getExtensionForDisplay({ contentType, fileName }); const extension = getExtensionForDisplay({ contentType, fileName });
@ -32,4 +30,3 @@ export class StagedGenericAttachment extends Component<Props> {
</div> </div>
); );
} }
}

Loading…
Cancel
Save