@wordpress/block-library
Version:
Block library for the WordPress editor.
31 lines (30 loc) • 1.16 kB
JavaScript
import { __ } from "@wordpress/i18n";
import { PlainText, useBlockProps } from "@wordpress/block-editor";
import { jsx, jsxs } from "react/jsx-runtime";
// packages/block-library/src/comments-pagination-previous/edit.jsx
const arrowMap = {
none: "",
arrow: "←",
chevron: "«"
};
function CommentsPaginationPreviousEdit({ attributes: { label }, setAttributes, context: { "comments/paginationArrow": paginationArrow } }) {
const displayArrow = arrowMap[paginationArrow];
return /* @__PURE__ */ jsxs("a", {
href: "#comments-pagination-previous-pseudo-link",
onClick: (event) => event.preventDefault(),
...useBlockProps(),
children: [displayArrow && /* @__PURE__ */ jsx("span", {
className: `wp-block-comments-pagination-previous-arrow is-arrow-${paginationArrow}`,
children: displayArrow
}), /* @__PURE__ */ jsx(PlainText, {
__experimentalVersion: 2,
tagName: "span",
"aria-label": __("Older comments page link"),
placeholder: __("Older Comments"),
value: label,
onChange: (newLabel) => setAttributes({ label: newLabel })
})]
});
}
export { CommentsPaginationPreviousEdit as default };
//# sourceMappingURL=edit.mjs.map