From 8d8c38e90bce13c3a0b833a5598a790c2086a267 Mon Sep 17 00:00:00 2001 From: Stixx Date: Mon, 9 Dec 2024 22:37:27 +0100 Subject: [PATCH] fix: addressing comments --- src/components/FileList/index.tsx | 61 +++++++++++++++---------------- 1 file changed, 29 insertions(+), 32 deletions(-) diff --git a/src/components/FileList/index.tsx b/src/components/FileList/index.tsx index 51ccdce..a073ca4 100644 --- a/src/components/FileList/index.tsx +++ b/src/components/FileList/index.tsx @@ -12,7 +12,6 @@ interface FileListProps { setCurrentFile: (file: CurrentUserFile) => void handleExport: () => void handleEncryptedExport?: () => void - downloadLabel?: string } const FileList = ({ @@ -20,8 +19,7 @@ const FileList = ({ currentFile, setCurrentFile, handleExport, - handleEncryptedExport, - downloadLabel + handleEncryptedExport }: FileListProps) => { const isActive = (file: CurrentUserFile) => file.id === currentFile.id return ( @@ -47,35 +45,34 @@ const FileList = ({ ))} - {!downloadLabel && ( - - {(popupState) => ( - - - - { - popupState.close - handleExport() - }} - > - Export Files - - { - popupState.close - handleEncryptedExport && handleEncryptedExport() - }} - > - Export Encrypted Files - - - - )} - - )} + + {(popupState) => ( + + + + { + popupState.close + handleExport() + }} + > + Export Files + + { + popupState.close + typeof handleEncryptedExport === 'function' && + handleEncryptedExport() + }} + > + Export Encrypted Files + + + + )} + ) }