UNPKG

@wordpress/block-library

Version:
41 lines (40 loc) 1.17 kB
import _extends from "@babel/runtime/helpers/esm/extends"; import { createElement } from "@wordpress/element"; /** * WordPress dependencies */ import { __ } from '@wordpress/i18n'; import { useBlockProps, PlainText } from '@wordpress/block-editor'; const arrowMap = { none: '', arrow: '→', chevron: '»' }; export default function CommentsPaginationNextEdit(_ref) { let { attributes: { label }, setAttributes, context: { 'comments/paginationArrow': paginationArrow } } = _ref; const displayArrow = arrowMap[paginationArrow]; return createElement("a", _extends({ href: "#comments-pagination-next-pseudo-link", onClick: event => event.preventDefault() }, useBlockProps()), createElement(PlainText, { __experimentalVersion: 2, tagName: "span", "aria-label": __('Newer comments page link'), placeholder: __('Newer Comments'), value: label, onChange: newLabel => setAttributes({ label: newLabel }) }), displayArrow && createElement("span", { className: `wp-block-comments-pagination-next-arrow is-arrow-${paginationArrow}` }, displayArrow)); } //# sourceMappingURL=edit.js.map