// packages/block-library/src/query-pagination-previous/edit.js
import { __ } from "@wordpress/i18n";
import { useBlockProps, PlainText } from "@wordpress/block-editor";
import { jsx, jsxs } from "react/jsx-runtime";
var arrowMap = {
  none: "",
  arrow: "\u2190",
  chevron: "\xAB"
};
function QueryPaginationPreviousEdit({
  attributes: { label },
  setAttributes,
  context: { paginationArrow, showLabel }
}) {
  const displayArrow = arrowMap[paginationArrow];
  return /* @__PURE__ */ jsxs(
    "a",
    {
      href: "#pagination-previous-pseudo-link",
      onClick: (event) => event.preventDefault(),
      ...useBlockProps(),
      children: [
        displayArrow && /* @__PURE__ */ jsx(
          "span",
          {
            className: `wp-block-query-pagination-previous-arrow is-arrow-${paginationArrow}`,
            "aria-hidden": true,
            children: displayArrow
          }
        ),
        showLabel && /* @__PURE__ */ jsx(
          PlainText,
          {
            __experimentalVersion: 2,
            tagName: "span",
            "aria-label": __("Previous page link"),
            placeholder: __("Previous Page"),
            value: label,
            onChange: (newLabel) => setAttributes({ label: newLabel })
          }
        )
      ]
    }
  );
}
export {
  QueryPaginationPreviousEdit as default
};
//# sourceMappingURL=edit.js.map
