UNPKG

@pdf-viewer/react

Version:

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

33 lines (32 loc) 1.46 kB
import { jsx as p } from "react/jsx-runtime"; import { useFullScreenContext as m } from "../../../../contexts/FullScreenContext.js"; import { UIButton as l } from "../../../ui/Button.js"; import { FullScreenIcon as u } from "../../../icons/FullScreenIcon.js"; import e from "../../../ui/RPTooltip.js"; import { useLocalizationContext as c } from "../../../../contexts/LocalizationContext.js"; import "react"; import "../../../../utils/hooks/useFullScreen.js"; import "../../../../clsx-0c6e471a.js"; import "../../../../utils/withRef.js"; import "../../../../index-c9a2990a.js"; import "react-dom"; import "../../../../floating-ui.react-dom-d22a10b4.js"; import "../../../../utils/appConsole.js"; import "../../../../utils/hooks/useLocalization.js"; import "../../../../de_DE-a553b162.js"; const S = ({ children: t, className: i, localeMessages: r }) => /* @__PURE__ */ p(e, { className: i, content: r == null ? void 0 : r.fullScreenTooltip, children: t }), R = ({ icon: t }) => { const { isFullScreen: i, toggleFullScreen: r, isSupported: n } = m(), { localeMessages: o } = c(); return /* @__PURE__ */ p(S, { localeMessages: o, children: /* @__PURE__ */ p( l, { disabled: !n, onClick: r, "aria-label": i ? (o == null ? void 0 : o.fullScreenTooltip) + " (Exit)" : o == null ? void 0 : o.fullScreenTooltip, "aria-pressed": i, children: t || /* @__PURE__ */ p(u, {}) } ) }); }; export { R as FullScreenTool };