@wordpress/block-library
Version:
Block library for the WordPress editor.
27 lines (22 loc) • 583 B
JavaScript
/**
* External dependencies
*/
import classNames from 'classnames';
/**
* WordPress dependencies
*/
import { InnerBlocks, RichText, useBlockProps } from '@wordpress/block-editor';
export default function save( { attributes } ) {
const { align, citation } = attributes;
const className = classNames( {
[ `has-text-align-${ align }` ]: align,
} );
return (
<blockquote { ...useBlockProps.save( { className } ) }>
<InnerBlocks.Content />
{ ! RichText.isEmpty( citation ) && (
<RichText.Content tagName="cite" value={ citation } />
) }
</blockquote>
);
}