wp.blocks.registerBlockType( 'movies/favorite-movie-quote', {
    title: 'Favorite movie quote',
    icon: 'format-quote',
    category: 'common',
    attributes: {
        content: {
            type: 'string',
            selector: 'blockquote',
        },
    },
    edit: function( props ) {
        let attributes = props.attributes;

        console.log(props.attributes);

        function onChangeContent( value ) {
            props.setAttributes( { content: value } );
        }

        return wp.element.createElement(
            'blockquote',
            null,
            wp.element.createElement(
                wp.components.TextControl,
                {
                    value: attributes.content,
                    onChange: onChangeContent,
                    placeholder: 'Enter favorite movie quote',
                }
            )
        );
    },
    save: function( props ) {
        return wp.element.createElement(
            'blockquote',
            null,
            props.attributes.content,
        );
    },
});
