| @@ -1,15 +1,19 @@ | ||
| 1 | 1 | import React from 'react'; |
| 2 | 2 | import { RawHTML } from '@wordpress/element'; |
| 3 | 3 | import { IFormBlockAttributes } from './registerFormBlock'; |
| 4 | +import useCustomCssBlockProps from '../Common/useCustomCssBlockProps'; | |
| 4 | 5 | |
| 6 | +const DefaultCssClasses = 'wp-block-leadin-hubspot-form-block'; | |
| 7 | + | |
| 5 | 8 | export default function FormSaveBlock({ attributes }: IFormBlockAttributes) { |
| 6 | - const { portalId, formId } = attributes; | |
| 9 | + const { portalId, formId, embedVersion } = attributes; | |
| 10 | + const blockProps = useCustomCssBlockProps(DefaultCssClasses); | |
| 7 | 11 | |
| 8 | 12 | if (portalId && formId) { |
| 9 | 13 | return ( |
| 10 | - <RawHTML className="wp-block-leadin-hubspot-form-block"> | |
| 11 | - {`[hubspot portal="${portalId}" id="${formId}" type="form"]`} | |
| 14 | + <RawHTML {...blockProps}> | |
| 15 | + {`[hubspot portal="${portalId}" id="${formId}" version="${embedVersion}" type="form"]`} | |
| 12 | 16 | </RawHTML> |
| 13 | 17 | ); |
| 14 | 18 | } |
| 15 | 19 | return null; |