/* Copyright 2021, vite-plugin-book by Mirone. */ import { createContext, Dispatch, FC, SetStateAction, useState } from 'react'; import { nope } from '../utils/helper'; type OutlineItem = { text: string; level: number; }; export type OutlineList = OutlineItem[]; export const OutlineCtx = createContext([]); export const SetOutlineCtx = createContext>>(nope); export const OutlineProvider: FC = ({ children }) => { const [outline, setOutline] = useState([]); return ( {children} ); };