import React from "react"; import Link from "component/link"; import FileDownloadLink from "component/fileDownloadLink"; import * as modals from "constants/modal_types"; class FileActions extends React.PureComponent { render() { const { fileInfo, uri, openModal, claimIsMine } = this.props; const claimId = fileInfo ? fileInfo.claim_id : null, showDelete = fileInfo && Object.keys(fileInfo).length > 0, showSupport = !claimIsMine; return (
{claimIsMine && } {showDelete && openModal(modals.CONFIRM_FILE_REMOVE, { uri })} />} {showSupport && }
); } } export default FileActions;