@pdf-viewer/react
Version:
A react-pdf-viewer component for React and Next.js. Suitable for react-pdf document.
22 lines (21 loc) • 504 B
JavaScript
import { jsx as r } from "react/jsx-runtime";
import { createContext as n, useContext as d } from "react";
const t = n(void 0), a = () => {
const o = d(t);
if (!o)
throw new Error("useDownloadContext must be used within a DownloadProvider");
return o;
}, u = ({ children: o, downloadFilename: e }) => /* @__PURE__ */ r(
t.Provider,
{
value: {
downloadFilename: e
},
children: o
}
);
export {
t as DownloadContext,
u as DownloadProvider,
a as useDownloadContext
};