import { Button, Card, Dialog } from '@automattic/components'; import { useTranslate } from 'i18n-calypso'; import { useState } from 'react'; import { useDispatch } from 'react-redux'; import { deleteReaderList } from 'calypso/state/reader/lists/actions'; function ListDelete( { list } ) { const translate = useTranslate(); const dispatch = useDispatch(); const [ showDeleteConfirmation, setShowDeleteConfirmation ] = useState( false ); return ( <>

{ translate( 'Delete the list forever. Be careful - this is not reversible.' ) }

{ showDeleteConfirmation && ( { setShowDeleteConfirmation( false ); if ( action === 'delete' ) { dispatch( deleteReaderList( list.ID, list.owner, list.slug ) ); } } } >

{ translate( 'Are you sure you want to delete this list?' ) }

{ translate( 'This action cannot be undone.' ) }

) } ); } export default ListDelete;