Bladeren bron

clean code

jam411 3 jaren geleden
bovenliggende
commit
4e1912135b
1 gewijzigde bestanden met toevoegingen van 2 en 5 verwijderingen
  1. 2 5
      packages/ui/src/components/Attachment/Attachment.tsx

+ 2 - 5
packages/ui/src/components/Attachment/Attachment.tsx

@@ -17,11 +17,8 @@ export const Attachment = (props: AttachmentProps): JSX.Element => {
     attachment, inUse, isUserLoggedIn, onAttachmentDeleteClicked,
     attachment, inUse, isUserLoggedIn, onAttachmentDeleteClicked,
   } = props;
   } = props;
 
 
-  const iconNameByFormat = (format) => {
-    if (format.match(/image\/.+/i)) {
-      return 'icon-picture';
-    }
-    return 'icon-doc';
+  const iconNameByFormat = (format: string) => {
+    return (format.match(/image\/.+/i)) ? 'icon-picture' : 'icon-doc';
   };
   };
 
 
   const _onAttachmentDeleteClicked = () => {
   const _onAttachmentDeleteClicked = () => {