mirror of
https://github.com/langgenius/dify.git
synced 2026-03-29 00:10:33 +08:00
20 lines
462 B
TypeScript
20 lines
462 B
TypeScript
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
|