import classnames from "classnames"; import { __ } from "@wordpress/i18n"; import { registerBlockType } from "@wordpress/blocks"; import { RichText } from "@wordpress/block-editor"; const IconRelatedBox = ( ); registerBlockType("custom-block/related-box", { title: __("Related Article"), description: __("Write related article in it."), keywords: [__("related article"), __("related")], category: "common", icon: IconRelatedBox, example: {}, attributes: { title: { type: "array", selector: ".related-box__link", source: "children", default: "", }, }, edit: (props) => { const { className, attributes: { title }, setAttributes, } = props; const onChangeTitle = (title) => setAttributes({ title }); const newClass = classnames(className, "related-box"); return (