- {__( 'Would you like you insert the scanned text under this image block? This enhances search indexing and accessibility for readers.', 'classifai' )}
-
-
-
-
-
-
-
-
- ;
-};
-
-registerPlugin( 'tenup-classifai-ocr-modal', {
- render: imageOcrModal,
-} );
-
/**
* Add insert button to toolbar.
*/
const imageOcrControl = createHigherOrderComponent( ( BlockEdit ) => { // eslint-disable-line no-unused-vars
return ( props ) => {
- const { attributes, clientId, isSelected, name } = props;
+ const [ isModalOpen, setModalOpen ] = useState( false );
+ const { attributes, clientId, isSelected, name, setAttributes } = props;
- if ( ! isSelected || 'core/image' != name || ! attributes.ocrScannedText ) {
+ if ( ! isSelected || 'core/image' != name ) {
return