1import { createContext, useContext } from "react"; 2 3/** 4 * A React context for sharing the `readOnly` state of the editor. 5 */ 6 7export const ReadOnlyContext = createContext(false); 8 9/** 10 * Get the current `readOnly` state of the editor. 11 */ 12 13export const useReadOnly = (): boolean => { 14 return useContext(ReadOnlyContext); 15}; 16 17