@wordpress/block-library
Version:
Block library for the WordPress editor.
24 lines (19 loc) • 475 B
JavaScript
/**
* External dependencies
*/
import classnames from 'classnames';
/**
* WordPress dependencies
*/
import { RichText, useBlockProps } from '@wordpress/block-editor';
export default function save( { attributes } ) {
const { textAlign, content } = attributes;
const className = classnames( {
[ `has-text-align-${ textAlign }` ]: textAlign,
} );
return (
<pre { ...useBlockProps.save( { className } ) }>
<RichText.Content value={ content } />
</pre>
);
}