diff --git a/src/admin-notes/add-email-note.js b/src/admin-notes/add-email-note.js deleted file mode 100644 index 89274e938b3..00000000000 --- a/src/admin-notes/add-email-note.js +++ /dev/null @@ -1,82 +0,0 @@ -/** - * External dependencies. - */ -import { useState } from '@wordpress/element'; -import { Button } from '@wordpress/components'; -import apiFetch from '@wordpress/api-fetch'; - -export const AddEmailNote = () => { - const [isAdding, setIsAdding] = useState(false); - const [hasAdded, setHasAdded] = useState(false); - const [errorMessage, setErrorMessage] = useState(false); - - async function triggerAddEmailNote() { - setIsAdding(true); - setHasAdded(false); - setErrorMessage(false); - - const name = prompt('Enter the note name'); - if (!name) { - setIsAdding(false); - return; - } - - const title = prompt('Enter the note title'); - if (!title) { - setIsAdding(false); - return; - } - - try { - await apiFetch({ - path: '/wc-admin-test-helper/admin-notes/add-email-note/v1', - method: 'POST', - data: { - name, - title, - }, - }); - setHasAdded(true); - } catch (ex) { - setErrorMessage(ex.message); - } - - setIsAdding(false); - } - - return ( - <> -

- - Add an email note - -

-

- This will add a new email note. Enable email - insights{' '} - - here - {' '} - and run the cron to send the note by email. -
- -
- - {isAdding && 'Adding, please wait'} - {hasAdded && 'Email note added'} - {errorMessage && ( - <> - Error: {errorMessage} - - )} - -

- - ); -};