UNPKG

@pdf-viewer/react

Version:

A react-pdf-viewer component for React and Next.js. Suitable for react-pdf document.

36 lines (35 loc) 2.02 kB
import { jsx as t, Fragment as u, jsxs as e } from "react/jsx-runtime"; import { G as a } from "../../../index-951f0f1f.js"; import { ClockwiseIcon as i } from "../../icons/ClockwiseIcon.js"; import { MenuItem as n } from "./MenuItem.js"; import { MenuSeparator as C } from "./MenuSeparator.js"; import { useRotate as s } from "../../../utils/hooks/useRotate.js"; import { useToolbarComponentContext as k } from "../../../contexts/ToolbarComponentContext.js"; import { useIconContext as m } from "../../../contexts/IconContext.js"; import c from "../../ui/RPTooltip.js"; import { useLocalizationContext as f } from "../../../contexts/LocalizationContext.js"; import '../../../assets/RotateTool.css';const d = { "rp-rotate-counterclockwise": "_rp-rotate-counterclockwise_1nqcb_1" }, w = () => { const { rotateClockwiseIcon: r } = m(); return r || /* @__PURE__ */ t(i, {}); }, h = () => { const { rotateCounterClockwiseIcon: r } = m(); return r || /* @__PURE__ */ t(i, { className: d["rp-rotate-counterclockwise"] }); }, G = () => { const { handleRotateClockwise: r, handleRotateCounterclockwise: l } = s(), { rotateTool: p } = k(), { localeMessages: o } = f(); return p ? /* @__PURE__ */ t(u, { children: /* @__PURE__ */ e(a, { children: [ /* @__PURE__ */ t(n, { onClick: r, children: /* @__PURE__ */ e(c, { className: "rp-menu-item", content: o == null ? void 0 : o.rotateClockwiseTooltip, children: [ /* @__PURE__ */ t("div", { className: "rp-menu-item-left", children: /* @__PURE__ */ t(w, {}) }), o == null ? void 0 : o.rotateClockwiseLabel ] }) }), /* @__PURE__ */ t(n, { onClick: l, children: /* @__PURE__ */ e(c, { className: "rp-menu-item", content: o == null ? void 0 : o.rotateCounterclockwiseTooltip, children: [ /* @__PURE__ */ t("div", { className: "rp-menu-item-left", children: /* @__PURE__ */ t(h, {}) }), o == null ? void 0 : o.rotateCounterclockwiseLabel ] }) }), /* @__PURE__ */ t(C, {}) ] }) }) : null; }; export { G as RotateTool };