| 1 |
import React from 'react'; |
| 2 |
import { RawHTML } from '@wordpress/element'; |
| 3 |
import { IMeetingBlockAttributes } from './registerMeetingBlock'; |
| 4 |
|
| 5 |
import useCustomCssBlockProps from '../Common/useCustomCssBlockProps'; |
| 6 |
|
| 7 |
const DefaultCssClasses = 'wp-block-leadin-hubspot-meeting-block'; |
| 8 |
|
| 9 |
export default function MeetingSaveBlock({ |
| 10 |
attributes, |
| 11 |
}: IMeetingBlockAttributes) { |
| 12 |
const { url } = attributes; |
| 13 |
const blockProps = useCustomCssBlockProps(DefaultCssClasses); |
| 14 |
|
| 15 |
if (url) { |
| 16 |
return ( |
| 17 |
<RawHTML |
| 18 |
{...blockProps} |
| 19 |
>{`[hubspot url="${url}" type="meeting"]`}</RawHTML> |
| 20 |
); |
| 21 |
} |
| 22 |
return null; |
| 23 |
} |
| 24 |
|