feat: init in-course AI features

This commit is contained in:
swve 2024-01-04 23:12:27 +01:00
parent 582e322155
commit a05b298c91
10 changed files with 471 additions and 146 deletions

View file

@ -0,0 +1,31 @@
import React, { useState } from 'react'
export const EditorProviderContext = React.createContext(null) as any;
type EditorProviderProps = {
children: React.ReactNode
options: EditorProviderState
}
type EditorProviderState = {
isEditable: boolean
}
function EditorOptionsProvider({ children, options }: EditorProviderProps) {
const [editorOptions, setEditorOptions] = useState<EditorProviderState>(options);
return (
<EditorProviderContext.Provider value={editorOptions}>
{children}
</EditorProviderContext.Provider>
)
}
export default EditorOptionsProvider
export function useEditorProvider() {
return React.useContext(EditorProviderContext);
}