/** * External dependencies */ import { __ } from '@wordpress/i18n'; import { useBlockProps, RichText, InspectorControls, } from '@wordpress/block-editor'; import { CheckboxControl } from '@woocommerce/blocks-components'; import { PanelBody, ToggleControl, Notice, ExternalLink, } from '@wordpress/components'; import { PRIVACY_URL, TERMS_URL } from '@woocommerce/block-settings'; import { ADMIN_URL } from '@woocommerce/settings'; import clsx from 'clsx'; /** * Internal dependencies */ import './editor.scss'; import { termsConsentDefaultText, termsCheckboxDefaultText } from './constants'; export const Edit = ( { attributes: { checkbox, text, showSeparator }, setAttributes, }: { attributes: { text: string; checkbox: boolean; showSeparator: boolean }; setAttributes: ( attributes: Record< string, unknown > ) => void; } ): JSX.Element => { const blockProps = useBlockProps(); const defaultText = checkbox ? termsCheckboxDefaultText : termsConsentDefaultText; const currentText = text || defaultText; return (
{ __( 'Ensure you add links to your policy pages in this section.', 'woocommerce' ) }