import { useCallback } from '@wordpress/element'; import { __, sprintf } from '@wordpress/i18n'; const statusMap = { draft: __('Draft'), publish: __('Published'), }; export const UpdatePostStatusConfirm = ({ inputs, onConfirm, onCancel }) => { const handleConfirm = () => { if (window?.extAgentData?.context) { window.extAgentData.context.postStatus = inputs.updatedStatus; } onConfirm({ data: inputs }); }; const handleCancel = useCallback(() => { onCancel(); }, [onCancel]); return (

{sprintf( // translators: %1$s is the current page or post status, and %2$s is the updated page or post status. __( 'Status will change from "%s" to "%s", please confirm to save.', 'extendify-local', ), statusMap[inputs.postStatus], statusMap[inputs.updatedStatus], )}

); };