PluginProbe
Extendify / 3.2.1
Extendify v3.2.1
3.2.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 All 127 releases
extendify / src / Agent / workflows / content / components / GeneratePageResult.jsx

GeneratePageResult.jsx in Extendify 3.2.1, at src/Agent/workflows/content/components/GeneratePageResult.jsx

45 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import { useCallback } from '@wordpress/element';
2 import { __ } from '@wordpress/i18n';
3
4 const { homeUrl } = window.extSharedData || {};
5
6 export const GeneratePageResult = ({ inputs, onConfirm }) => {
7 const handleConfirm = useCallback(() => {
8 const redirectUrl = inputs.postId
9 ? `${homeUrl}/?page_id=${inputs.postId}`
10 : '';
11 onConfirm({ redirectUrl });
12 }, [inputs.postId, onConfirm]);
13
14 return (
15 <div className="mb-4 ms-2 me-2 flex flex-col rounded-lg border border-gray-300 bg-gray-50">
16 <div className="rounded-lg border-b border-gray-300 bg-white">
17 <div className="p-3">
18 <p className="m-0 p-0 text-sm text-gray-900">
19 {__(
20 'The agent has finished creating your page. Press take me there to visit your new page or dismiss to remove this notice.',
21 'extendify-local',
22 )}
23 </p>
24 </div>
25 </div>
26 <div className="flex justify-start gap-2 p-3">
27 <button
28 type="button"
29 className="w-full rounded-sm border border-gray-500 bg-white p-2 text-sm text-gray-900"
30 onClick={onConfirm}
31 >
32 {__('Dismiss', 'extendify-local')}
33 </button>
34 <button
35 type="button"
36 className="w-full rounded-sm border border-design-main bg-design-main p-2 text-sm text-white"
37 onClick={handleConfirm}
38 >
39 {__('Take me there', 'extendify-local')}
40 </button>
41 </div>
42 </div>
43 );
44 };
45