PluginProbe
Extendify / 2.3.1
Extendify v2.3.1
3.2.0 3.1.6 3.1.5 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 3.0.6 3.0.5 3.0.4 trunk 0.1.0 0.10.0 0.10.1 0.10.2 0.11.0 0.11.1 0.2.0 0.3.0 0.3.1 0.4.0 0.5.0 0.6.0 0.7.0 All 126 releases
extendify / src / Draft / components / DraftMenu.jsx

DraftMenu.jsx in Extendify 2.3.1, at src/Draft/components/DraftMenu.jsx

49 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import { MenuGroup, MenuItem } from '@wordpress/components';
2 import { __ } from '@wordpress/i18n';
3 import { pencil } from '@wordpress/icons';
4
5 export const DraftMenu = ({ disabled, setInputText, setReady }) => {
6 const handleClick = (inputText) => {
7 setInputText(inputText);
8 setReady(false);
9 };
10
11 const actionsList = [
12 {
13 label: __('A paragraph …', 'extendify-local'),
14 onClickText: __('Write a paragraph about', 'extendify-local'),
15 },
16 {
17 label: __('Blog post …', 'extendify-local'),
18 onClickText: __('Write a blog post about', 'extendify-local'),
19 },
20 {
21 label: __('An informative article …', 'extendify-local'),
22 onClickText: __('Write an informative article about', 'extendify-local'),
23 },
24 {
25 label: __('Headline …', 'extendify-local'),
26 onClickText: __('Write a headline for', 'extendify-local'),
27 },
28 {
29 label: __('List …', 'extendify-local'),
30 onClickText: __('Write a list of', 'extendify-local'),
31 },
32 ];
33
34 return (
35 <MenuGroup>
36 {actionsList.map(({ label, onClickText }) => (
37 <MenuItem
38 key={label}
39 onClick={() => handleClick(`${onClickText} `)}
40 disabled={disabled}
41 icon={pencil}
42 iconPosition="left">
43 {label}
44 </MenuItem>
45 ))}
46 </MenuGroup>
47 );
48 };
49