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';
interface Props {
type Props = {
attachment: AttachmentType;
onClose: (attachment: AttachmentType) => void;
}
};
export class StagedGenericAttachment extends Component<Props> {
public render() {
const { attachment, onClose } = this.props;
export function StagedGenericAttachment(props: Props) {
const { attachment, onClose } = props;
const { fileName, contentType } = attachment;
const extension = getExtensionForDisplay({ contentType, fileName });
@ -31,5 +29,4 @@ export class StagedGenericAttachment extends Component<Props> {
<div className="module-staged-generic-attachment__filename">{fileName}</div>
</div>
);
}
}

Loading…
Cancel
Save