mirror of https://github.com/langgenius/dify.git
refactor: update UserActionItem component props and improve dependency management in useFormContent
This commit is contained in:
parent
2969a77b15
commit
d80167d9ec
|
|
@ -12,13 +12,13 @@ import ButtonStyleDropdown from './button-style-dropdown'
|
|||
|
||||
const i18nPrefix = 'workflow.nodes.humanInput'
|
||||
|
||||
type Props = {
|
||||
type UserActionItemProps = {
|
||||
data: UserAction
|
||||
onChange: (state: UserAction) => void
|
||||
onDelete: (id: string) => void
|
||||
}
|
||||
|
||||
const UserActionItem: FC<Props> = ({
|
||||
const UserActionItem: FC<UserActionItemProps> = ({
|
||||
data,
|
||||
onChange,
|
||||
onDelete,
|
||||
|
|
|
|||
|
|
@ -168,7 +168,7 @@ const Panel: FC<NodePanelProps<HumanInputNodeType>> = ({
|
|||
<div className="space-y-2">
|
||||
{inputs.user_actions.map((action, index) => (
|
||||
<UserActionItem
|
||||
key={action.id}
|
||||
key={index}
|
||||
data={action}
|
||||
onChange={data => handleUserActionChange(index, data)}
|
||||
onDelete={handleUserActionDelete}
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ const useFormContent = (id: string, payload: HumanInputNodeType) => {
|
|||
})
|
||||
setInputs(newInputs)
|
||||
setEditorKey(editorKey => editorKey + 1)
|
||||
}, [setInputs, editorKey])
|
||||
}, [setInputs])
|
||||
|
||||
return {
|
||||
editorKey,
|
||||
|
|
|
|||
Loading…
Reference in New Issue