| 1 |
import classnames from 'classnames/dedupe'; |
| 2 |
|
| 3 |
import { useBlockProps, useInnerBlocksProps } from '@wordpress/block-editor'; |
| 4 |
import { applyFilters } from '@wordpress/hooks'; |
| 5 |
|
| 6 |
import metadata from './block.json'; |
| 7 |
|
| 8 |
const { name } = metadata; |
| 9 |
|
| 10 |
/** |
| 11 |
* Block Save component. |
| 12 |
* |
| 13 |
* @param props |
| 14 |
*/ |
| 15 |
export default function BlockSave(props) { |
| 16 |
const { align } = props.attributes; |
| 17 |
|
| 18 |
let className = classnames( |
| 19 |
'ghostkit-form-submit-button', |
| 20 |
align && align !== 'none' |
| 21 |
? `ghostkit-form-submit-button-align-${align}` |
| 22 |
: false |
| 23 |
); |
| 24 |
|
| 25 |
className = applyFilters('ghostkit.blocks.className', className, { |
| 26 |
name, |
| 27 |
...props, |
| 28 |
}); |
| 29 |
|
| 30 |
const blockProps = useBlockProps.save({ className }); |
| 31 |
const innerBlocksProps = useInnerBlocksProps.save(blockProps); |
| 32 |
|
| 33 |
return <div {...innerBlocksProps} />; |
| 34 |
} |
| 35 |
|