import { CurrentUserFile } from '../../types/file.ts' import styles from './style.module.scss' import { Button, Menu, MenuItem } from '@mui/material' import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' import { faCheck } from '@fortawesome/free-solid-svg-icons' import PopupState, { bindTrigger, bindMenu } from 'material-ui-popup-state' import React from 'react' interface FileListProps { files: CurrentUserFile[] currentFile: CurrentUserFile setCurrentFile: (file: CurrentUserFile) => void handleExport: () => void handleEncryptedExport?: () => void downloadLabel?: string } const FileList = ({ files, currentFile, setCurrentFile, handleExport, handleEncryptedExport, downloadLabel }: FileListProps) => { const isActive = (file: CurrentUserFile) => file.id === currentFile.id return (
{!downloadLabel && ( {(popupState) => ( { popupState.close handleExport() }} > Export Files { popupState.close handleEncryptedExport && handleEncryptedExport() }} > Export Encrypted Files )} )}
) } export default FileList