import { registerBlockType } from '@wordpress/blocks';
import { __ } from '@wordpress/i18n';
import { InnerBlocks, useBlockProps } from '@wordpress/block-editor';
import { defaultBlock } from '../../icons';
import metadata from './block.json';

const Edit = () => {
    const blockProps = useBlockProps();
    const TEMPLATE = [
        ['core/paragraph', { content: __('Transaction not found. Please contact support.', 'memberpress') }]
    ];

    return (
        <div {...blockProps}>
            <InnerBlocks template={TEMPLATE} templateLock="all" />
        </div>
    );
};

const Save = () => {
    return <InnerBlocks.Content />;
};

registerBlockType(metadata.name, {
    ...metadata,
    icon: defaultBlock,
    edit: Edit,
    save: Save
});
