feat: code support vars

This commit is contained in:
Joel
2024-02-20 18:42:21 +08:00
parent bb87a350ac
commit d58a1b1359
11 changed files with 149 additions and 20 deletions

View File

@ -0,0 +1,19 @@
import { useState } from 'react'
import useVarList from '../_base/hooks/use-var-list'
import type { CodeNodeType } from './types'
const useConfig = (initInputs: CodeNodeType) => {
const [inputs, setInputs] = useState<CodeNodeType>(initInputs)
const { handleVarListChange, handleAddVariable } = useVarList<CodeNodeType>({
inputs,
setInputs,
})
return {
inputs,
handleVarListChange,
handleAddVariable,
}
}
export default useConfig