// @flow import React from 'react'; import { Modal } from 'modal/modal'; import { FormRow, FormField } from 'component/common/form'; type Props = { 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 { claimIsMine, closeModal, deleteFile, fileInfo: { outpoint }, title, } = this.props; const { deleteChecked, abandonClaimChecked } = this.state; return ( deleteFile(outpoint, deleteChecked, abandonClaimChecked)} onAborted={closeModal} >

{__('Remove File')}

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

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