2022-12-22 15:01:01 +00:00
|
|
|
/**
|
|
|
|
* External dependencies
|
|
|
|
*/
|
2024-05-31 03:49:36 +00:00
|
|
|
import clsx from 'clsx';
|
2022-12-22 15:01:01 +00:00
|
|
|
import { InspectorControls, useBlockProps } from '@wordpress/block-editor';
|
|
|
|
import { Disabled } from '@wordpress/components';
|
|
|
|
import type { BlockEditProps } from '@wordpress/blocks';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Internal dependencies
|
|
|
|
*/
|
|
|
|
import Block from './block';
|
|
|
|
import { Attributes } from './types';
|
|
|
|
import { BlockSettings } from './sidebar-settings';
|
|
|
|
import './editor.scss';
|
|
|
|
|
|
|
|
const Edit = ( {
|
|
|
|
attributes,
|
|
|
|
setAttributes,
|
|
|
|
}: BlockEditProps< Attributes > ) => {
|
|
|
|
const { className } = attributes;
|
|
|
|
const blockProps = useBlockProps( {
|
2024-05-31 03:49:36 +00:00
|
|
|
className: clsx( 'wc-block-editor-customer-account', className ),
|
2022-12-22 15:01:01 +00:00
|
|
|
} );
|
|
|
|
|
|
|
|
return (
|
|
|
|
<>
|
|
|
|
<div { ...blockProps }>
|
|
|
|
<InspectorControls>
|
|
|
|
<BlockSettings
|
|
|
|
attributes={ attributes }
|
|
|
|
setAttributes={ setAttributes }
|
|
|
|
/>
|
|
|
|
</InspectorControls>
|
|
|
|
<Disabled>
|
|
|
|
<Block attributes={ attributes } />
|
|
|
|
</Disabled>
|
|
|
|
</div>
|
|
|
|
</>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default Edit;
|