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.' ) } setShowDeleteConfirmation( true ) }> { translate( 'Delete list' ) } { 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;
{ translate( 'Delete the list forever. Be careful - this is not reversible.' ) }
{ translate( 'This action cannot be undone.' ) }