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