// @flow import React from 'react'; import { Modal } from 'modal/modal'; import { FormField } from 'component/common/form'; import Button from 'component/button'; import usePersistedState from 'effects/use-persisted-state'; import Card from 'component/common/card'; import I18nMessage from 'component/i18nMessage'; import LbcSymbol from 'component/common/lbc-symbol'; type Props = { uri: string, claim: StreamClaim, claimIsMine: boolean, doResolveUri: (string) => void, closeModal: () => void, deleteFile: (string, boolean, boolean, boolean, any) => void, doGoBack: boolean, title: string, fileInfo?: { outpoint: ?string, }, isAbandoning: boolean, }; function ModalRemoveFile(props: Props) { const { uri, claimIsMine, doResolveUri, closeModal, deleteFile, doGoBack = true, title, claim, isAbandoning } = props; const [deleteChecked, setDeleteChecked] = usePersistedState('modal-remove-file:delete', true); const [abandonChecked, setAbandonChecked] = usePersistedState('modal-remove-file:abandon', true); React.useEffect(() => { if (uri) { doResolveUri(uri); } }, [uri, doResolveUri]); return ( {`"${title}"`} }}> Are you sure you'd like to remove %title%? } body={ {/* @if TARGET='app' */} setDeleteChecked(!deleteChecked)} /> {/* @endif */} {claimIsMine && ( }}> Remove from blockchain (%lbc%) } type="checkbox" checked={abandonChecked} onChange={() => 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 */}
)}
} actions={ <>

{__('These changes will appear shortly.')}

} />
); } export default ModalRemoveFile;