| 1 |
import { __ } from '@wordpress/i18n'; |
| 2 |
|
| 3 |
export const UpdateSearchIndexingConfirm = ({ |
| 4 |
inputs, |
| 5 |
onConfirm, |
| 6 |
onCancel, |
| 7 |
}) => { |
| 8 |
const willEnable = inputs?.indexing |
| 9 |
? inputs.indexing === 'enabled' |
| 10 |
: Boolean(window.extAgentData?.agentContext?.searchEnginesBlocked); |
| 11 |
|
| 12 |
const handleConfirm = () => { |
| 13 |
onConfirm({ |
| 14 |
data: { indexing: willEnable ? 'enabled' : 'disabled' }, |
| 15 |
shouldRefreshPage: true, |
| 16 |
}); |
| 17 |
}; |
| 18 |
|
| 19 |
return ( |
| 20 |
<div className="mb-4 ms-2 me-2 flex flex-col rounded-lg border border-gray-300 bg-gray-50"> |
| 21 |
<div className="rounded-lg border-b border-gray-300 bg-white"> |
| 22 |
<div className="p-3"> |
| 23 |
<p className="m-0 p-0 text-sm text-gray-900"> |
| 24 |
{willEnable |
| 25 |
? __( |
| 26 |
'Search engines will be allowed to index your site. Confirm to let them find it.', |
| 27 |
'extendify-local', |
| 28 |
) |
| 29 |
: __( |
| 30 |
'Search engines will be asked not to index your site. Visitors can still see it. Confirm to discourage indexing.', |
| 31 |
'extendify-local', |
| 32 |
)} |
| 33 |
</p> |
| 34 |
</div> |
| 35 |
</div> |
| 36 |
<div className="flex justify-start gap-2 p-3"> |
| 37 |
<button |
| 38 |
type="button" |
| 39 |
className="w-full rounded-sm border border-gray-500 bg-white p-2 text-sm text-gray-900" |
| 40 |
onClick={onCancel} |
| 41 |
> |
| 42 |
{__('Cancel', 'extendify-local')} |
| 43 |
</button> |
| 44 |
<button |
| 45 |
type="button" |
| 46 |
className="w-full rounded-sm border border-design-main bg-design-main p-2 text-sm text-white" |
| 47 |
onClick={handleConfirm} |
| 48 |
> |
| 49 |
{__('Confirm', 'extendify-local')} |
| 50 |
</button> |
| 51 |
</div> |
| 52 |
</div> |
| 53 |
); |
| 54 |
}; |
| 55 |
|