import { createContext } from 'react'; import { HighlightContextProps } from './highlight.types'; export type HighlightContextType = React.Context< HighlightContextProps >; export const createHighlightContext = ( displayName?: string, ): HighlightContextType => { const context = createContext>({ highlight: undefined, }); context.displayName = displayName ?? 'HighlightContext'; return context; };