// @flow import React from 'react'; import { Modal } from 'modal/modal'; import { Form, FormField } from 'component/common/form'; import Button from 'component/button'; import usePersistedState from 'effects/use-persisted-state'; type Props = { uri: string, claim: StreamClaim, claimIsMine: boolean, closeModal: () => void, deleteFile: (string, boolean, boolean) => void, title: string, fileInfo?: { outpoint: ?string, }, }; function ModalRemoveFile(props: Props) { const { uri, claimIsMine, closeModal, deleteFile, title, claim } = props; const [deleteChecked, setDeleteChecked] = usePersistedState('modal-remove-file:delete', true); const [abandonChecked, setAbandonChecked] = usePersistedState('modal-remove-file:abandon', true); return (

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

deleteFile(uri, deleteChecked, claimIsMine ? abandonChecked : false)}> {/* @if TARGET='app' */} setDeleteChecked(!deleteChecked)} /> {/* @endif */} {claimIsMine && (
setAbandonChecked(!abandonChecked)} /> {abandonChecked === true &&

This action is permanent and cannot be undone.

} {/* @if TARGET='app' */} {abandonChecked === false && deleteChecked && (

This file will be removed from your Library and Downloads folder.

)} {!deleteChecked &&

This file will be removed from your Library but will remain in your Downloads folder.

} {/* @endif */}
)}
); } export default ModalRemoveFile;