// @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, closeModal: () => void, deleteFile: (string, boolean, boolean) => void, title: string, fileInfo?: { outpoint: ?string, }, isAbandoning: boolean, }; function ModalRemoveFile(props: Props) { const { uri, claimIsMine, closeModal, deleteFile, title, claim, isAbandoning } = props; const [deleteChecked, setDeleteChecked] = usePersistedState('modal-remove-file:delete', true); const [abandonChecked, setAbandonChecked] = usePersistedState('modal-remove-file:abandon', true); 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;