// @flow import React from 'react'; import { Modal } from 'modal/modal'; import { FormField } from 'component/common/form'; type Props = { claim: StreamClaim, claimIsMine: boolean, closeModal: () => void, deleteFile: (string, boolean, boolean) => void, title: string, fileInfo?: { outpoint: ?string, }, }; type State = { deleteChecked: boolean, abandonClaimChecked: boolean, }; class ModalRemoveFile extends React.PureComponent { constructor(props: Props) { super(props); this.state = { deleteChecked: false, abandonClaimChecked: true, }; (this: any).handleDeleteCheckboxClicked = this.handleDeleteCheckboxClicked.bind(this); (this: any).handleAbandonClaimCheckboxClicked = this.handleAbandonClaimCheckboxClicked.bind(this); } handleDeleteCheckboxClicked() { const { deleteChecked } = this.state; this.setState({ deleteChecked: !deleteChecked, }); } handleAbandonClaimCheckboxClicked() { const { abandonClaimChecked } = this.state; this.setState({ abandonClaimChecked: !abandonClaimChecked, }); } render() { const { claim, claimIsMine, closeModal, deleteFile, fileInfo, title } = this.props; const { deleteChecked, abandonClaimChecked } = this.state; const { txid, nout } = claim; const outpoint = fileInfo ? fileInfo.outpoint : `${txid}:${nout}`; return ( deleteFile(outpoint || '', deleteChecked, abandonClaimChecked)} onAborted={closeModal} >

{__("Are you sure you'd like to remove")} {`"${title}"`} {__('from the LBRY app?')}

{claimIsMine && ( )}
); } } export default ModalRemoveFile;