// @flow import React, { useState } from 'react'; import { Modal } from 'modal/modal'; import Button from 'component/button'; import Card from 'component/common/card'; import I18nMessage from 'component/i18nMessage'; import { useHistory } from 'react-router-dom'; import { FormField } from 'component/common/form'; type Props = { closeModal: () => void, collectionDelete: (string, ?string) => void, claim: Claim, collectionId: string, collectionName: string, uri: ?string, redirect: ?string, }; function ModalRemoveCollection(props: Props) { const { closeModal, claim, collectionDelete, collectionId, collectionName, uri, redirect } = props; const title = claim && claim.value && claim.value.title; const { replace } = useHistory(); const [confirmName, setConfirmName] = useState(''); return (

{__('This will permanently delete the list.')}

{__('Type "%name%" to confirm.', { name: collectionName })}

setConfirmName(e.target.value)} /> ) : ( {uri && title ? `"${title}"` : `"${collectionName}"`} }}> Are you sure you'd like to remove collection %title%? ) } actions={ <>
} />
); } export default ModalRemoveCollection;