PluginProbe
Extendify / 3.2.3
Extendify v3.2.3
3.2.3 3.2.2 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 All 129 releases
extendify / src / Agent / workflows / content / components / UpdatePostStatusConfirm.jsx

UpdatePostStatusConfirm.jsx in Extendify 3.2.3, at src/Agent/workflows/content/components/UpdatePostStatusConfirm.jsx

54 lines 1.5 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 { __, sprintf } from '@wordpress/i18n';
3
4 const statusMap = {
5 draft: __('Draft'),
6 publish: __('Published'),
7 };
8
9 export const UpdatePostStatusConfirm = ({ inputs, onConfirm, onCancel }) => {
10 const handleConfirm = () => {
11 onConfirm({ data: inputs, shouldRefreshPage: true });
12 };
13
14 const handleCancel = useCallback(() => {
15 onCancel();
16 }, [onCancel]);
17
18 return (
19 <div className="mb-4 ms-2 me-2 flex flex-col rounded-lg border border-gray-300 bg-gray-50">
20 <div className="rounded-lg border-b border-gray-300 bg-white">
21 <div className="p-3">
22 <p className="m-0 p-0 text-sm text-gray-900">
23 {sprintf(
24 // translators: %1$s is the current page or post status, and %2$s is the updated page or post status.
25 __(
26 'Status will change from "%s" to "%s", please confirm to save.',
27 'extendify-local',
28 ),
29 statusMap[inputs.postStatus],
30 statusMap[inputs.updatedStatus],
31 )}
32 </p>
33 </div>
34 </div>
35 <div className="flex justify-start gap-2 p-3">
36 <button
37 type="button"
38 className="w-full rounded-sm border border-gray-500 bg-white p-2 text-sm text-gray-900"
39 onClick={handleCancel}
40 >
41 {__('Cancel', 'extendify-local')}
42 </button>
43 <button
44 type="button"
45 className="w-full rounded-sm border border-design-main bg-design-main p-2 text-sm text-white"
46 onClick={handleConfirm}
47 >
48 {__('Confirm', 'extendify-local')}
49 </button>
50 </div>
51 </div>
52 );
53 };
54