mirror of
https://github.com/labring/FastGPT.git
synced 2026-04-25 02:01:53 +08:00
88ed97bc9d
* stop design doc * remove invalid doc * perf: auto fit * fix: icon * perf: icon * perf: icon * perf: icon * perf: icon * perf: variable disabled input ui * fix: workflow batch run * fix: tsc
13 lines
353 B
TypeScript
13 lines
353 B
TypeScript
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
|
|
import { useEffect } from 'react';
|
|
|
|
export default function EditablePlugin({ isDisabled }: { isDisabled: boolean }) {
|
|
const [editor] = useLexicalComposerContext();
|
|
|
|
useEffect(() => {
|
|
editor.setEditable(!isDisabled);
|
|
}, [editor, isDisabled]);
|
|
|
|
return null;
|
|
}
|