@wordpress/block-library
Version:
Block library for the WordPress editor.
23 lines (20 loc) • 484 B
JavaScript
/**
* WordPress dependencies
*/
import { __ } from '@wordpress/i18n';
/**
* Internal dependencies
*/
import { PlainText } from '@wordpress/block-editor';
export default function CodeEdit( { attributes, setAttributes, className } ) {
return (
<div className={ className }>
<PlainText
value={ attributes.content }
onChange={ ( content ) => setAttributes( { content } ) }
placeholder={ __( 'Write code…' ) }
aria-label={ __( 'Code' ) }
/>
</div>
);
}