feat: add code editor

This commit is contained in:
Joel
2024-03-05 17:37:20 +08:00
parent e474e02a50
commit d3dfadbd9b
7 changed files with 55 additions and 14 deletions

View File

@ -17,14 +17,14 @@ const useConfig = (id: string, payload: CodeNodeType) => {
draft.code = code
})
setInputs(newInputs)
}, [setInputs])
}, [inputs, setInputs])
const handleCodeLanguageChange = useCallback((codeLanguage: CodeLanguage) => {
const newInputs = produce(inputs, (draft) => {
draft.code_language = codeLanguage
})
setInputs(newInputs)
}, [setInputs])
}, [inputs, setInputs])
const { handleVarListChange: handleOutputVarListChange, handleAddVariable: handleAddOutputVariable } = useOutputVarList<CodeNodeType>({
inputs,