import type { Editor } from '@milkdown/kit/core' import type { FC, ReactNode } from 'react' import React, { useMemo, useRef, useState } from 'react' import type { EditorInfoCtx, GetEditor } from './types' import { editorInfoContext, useGetEditor } from './use-get-editor' export const Milkdown: FC = () => { const domRef = useGetEditor() return
} export const MilkdownProvider: FC<{ children: ReactNode }> = ({ children }) => { const dom = useRef(undefined) const [editorFactory, setEditorFactory] = useState( undefined ) const editor = useRef(undefined) const [loading, setLoading] = useState(true) const editorInfoCtx = useMemo( () => ({ loading, dom, editor, setLoading, editorFactory, setEditorFactory, }), [loading, editorFactory] ) return ( {children} ) }