UNPKG

@pdf-viewer/react

Version:

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

18 lines (17 loc) 1.14 kB
import { jsx as o, Fragment as u } from "react/jsx-runtime"; import { i as a } from "../../../ToolbarLayout.module-cbc8e216.js"; import { ThumbnailIcon as h } from "../../icons/Thumbnail.js"; import { UIButton as p } from "../../ui/Button.js"; import e from "../../ui/RPTooltip.js"; import { useLocalizationContext as T } from "../../../contexts/LocalizationContext.js"; import { useToolComponentContext as f } from "../../../contexts/ToolComponentContext.js"; import { useIconToolContext as s } from "../../../contexts/IconToolContext.js"; const y = () => { const { active: t, setActive: c } = a(), { thumbnailIcon: l } = s(), { thumbnailTool: n = !0 } = f(), { localeMessages: i } = T(), r = i == null ? void 0 : i.thumbnailTooltip, m = () => { c(!t); }; return n ? typeof n == "function" ? /* @__PURE__ */ o(e, { content: r, children: /* @__PURE__ */ o(n, { onClick: m, active: t }) }) : /* @__PURE__ */ o(u, { children: /* @__PURE__ */ o(e, { content: r, children: /* @__PURE__ */ o(p, { onClick: m, active: t, "aria-label": r, children: l || /* @__PURE__ */ o(h, {}) }) }) }) : null; }; export { y as ThumbnailTool };