import {__, sprintf} from '@wordpress/i18n';
import ModalDialog from '@givewp/components/AdminUI/ModalDialog';
import {CheckVerified, StarsIcon} from '@givewp/components/AdminUI/Icons';
import Button from '@givewp/components/AdminUI/Button';
import styles from '../style.module.scss';
import {createInterpolateElement} from '@wordpress/element';
export default function FeatureNoticeDialog({isUpgrading, isEditing, handleClose}) {
const {supportedAddons, supportedGateways, migrationApiRoot, apiNonce} = window.GiveDonationForms;
const handleUpgrade = async () => {
// @ts-ignore
const response = await fetch(migrationApiRoot + '/' + window.give_vars.post_id, {
method: 'post',
headers: {
'Content-Type': 'application/json',
'X-WP-Nonce': apiNonce,
},
});
const data = await response.json();
if (response.ok) {
window.location = data.redirect;
} else {
alert('Error migrating form');
}
};
// @note the component does not support the `className` prop.
const upgradeButtonStyles = {
width: '100%',
marginTop: 'var(--givewp-spacing-6)',
marginBottom: 'var(--givewp-spacing-4)',
backgroundColor: 'var(--wp-blue-blue-50)',
};
return (
<>
{__("What's new", 'give')}
{createInterpolateElement(
sprintf(
__(
'GiveWP 3.0 introduces an enhanced forms experience powered by the new Visual Donation Form Builder. The team is still working on add-on and gateway compatibility. If you need to use an add-on or gateway that isn\'t listed, use the "%sAdd form%s" option for now.',
'give'
),
'',
''
),
{
b: ,
}
)}