/** * External dependencies */ import { __ } from '@wordpress/i18n'; import { useState } from '@wordpress/element'; import { CheckboxControl } from '@woocommerce/blocks-checkout'; import Textarea from '@woocommerce/base-components/textarea'; import PropTypes from 'prop-types'; /** * Internal dependencies */ import './style.scss'; const CheckoutOrderNotes = ( { disabled, onChange, placeholder, value } ) => { const [ withOrderNotes, setWithOrderNotes ] = useState( false ); // Store order notes when the textarea is hidden. This allows us to recover // text entered previously by the user when the checkbox is re-enabled // while keeping the context clean if the checkbox is disabled. const [ hiddenOrderNotesText, setHiddenOrderNotesText ] = useState( '' ); return (