Something went wrong. Try again.
a tool for shared writing and social publishing
Something went wrong. Try again.
425 B · 18 lines
TSX
at perf/paste
12345678910111213141516171819import { createContext, useContext } from "react";import type { FootnoteInfo } from "./usePageFootnotes";
type FootnoteContextValue = { pageID: string; footnotes: FootnoteInfo[]; indexMap: Record<string, number>;};
export const FootnoteContext = createContext<FootnoteContextValue>({ pageID: "", footnotes: [], indexMap: {},});
export function useFootnoteContext() { return useContext(FootnoteContext);}