import { __ } from '@wordpress/i18n'; export const UpdateSiteVisibilityConfirm = ({ onConfirm, onCancel }) => { // skipAgent resolves no inputs, so the direction comes from the current state. const isPublished = Boolean(window.extAgentData?.agentContext?.sitePublished); const handleConfirm = () => { onConfirm({ data: { visibility: isPublished ? 'unpublished' : 'published' }, shouldRefreshPage: true, }); }; return (
{isPublished ? __( 'Your site will be hidden from visitors until you publish it again. Confirm to take it offline.', 'extendify-local', ) : __( 'Your site will become visible to everyone. Confirm to take it live.', 'extendify-local', )}