/**
 * Cognito Forms WordPress Plugin
 */

import { registerBlockType } from '@wordpress/blocks';
import { IBlockAttributes } from './types';

/**
 * Internal dependencies
 */
import Edit from './edit';
import Save from './save';

/**
 * Stylesheets
 */
import './styles/editor.scss';
import './styles/style.scss';

import { ReactComponent as CogIcon } from '@/../cogicon.svg';

registerBlockType<IBlockAttributes>( 'cognito-forms/cognito-embed', {
	title: 'Cognito Forms',
	icon: CogIcon,
	description: 'Easily build powerful forms.',
	category: 'embed',
	supports: {
		// Removes support for an HTML mode.
		html: false,
	},
	attributes: {
		orgId: {
			type: 'string',
		},
		formId: {
			type: 'string',
		},
		seamlessEmbedCode: {
			type: 'string',
		},
		iframeEmbedCode: {
			type: 'string',
		},
		ampEmbedCode: {
			type: 'string',
		},
		embedMode: {
			type: 'number',
		},
	},
	edit: Edit,
	save: Save,
} );
