UNPKG

@pdf-viewer/react

Version:

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

22 lines (21 loc) 979 B
import { jsx as t } from "react/jsx-runtime"; import { useFullScreenContext as i } from "../../../../contexts/FullScreenContext.js"; import { UIButton as c } from "../../../ui/Button.js"; import { FullScreenIcon as u } from "../../../icons/FullScreenIcon.js"; import m from "../../../ui/RPTooltip.js"; import { useLocalizationContext as p } from "../../../../contexts/LocalizationContext.js"; const f = ({ children: r, className: l, localeMessages: o }) => /* @__PURE__ */ t(m, { className: l, content: o == null ? void 0 : o.fullScreenTooltip, children: r }), C = ({ icon: r }) => { const { isFullScreen: l, toggleFullScreen: o, isSupported: n } = i(), { localeMessages: e } = p(); return /* @__PURE__ */ t(f, { localeMessages: e, children: /* @__PURE__ */ t( c, { disabled: !n, onClick: o, "aria-label": l ? "Exit full screen" : "Enter full screen", children: r || /* @__PURE__ */ t(u, {}) } ) }); }; export { C as FullScreenTool };