UNPKG

@wordpress/block-library

Version:
32 lines (28 loc) 691 B
/** * External dependencies */ import classnames from 'classnames'; /** * WordPress dependencies */ import { RichText, useBlockProps } from '@wordpress/block-editor'; export default function save( { attributes } ) { const { textAlign, citation, value } = attributes; const shouldShowCitation = ! RichText.isEmpty( citation ); return ( <figure { ...useBlockProps.save( { className: classnames( { [ `has-text-align-${ textAlign }` ]: textAlign, } ), } ) } > <blockquote> <RichText.Content tagName="p" value={ value } /> { shouldShowCitation && ( <RichText.Content tagName="cite" value={ citation } /> ) } </blockquote> </figure> ); }