refactor: update UserActionItem component props and improve dependency management in useFormContent

This commit is contained in:
twwu 2025-12-26 15:09:04 +08:00
parent 2969a77b15
commit d80167d9ec
3 changed files with 4 additions and 4 deletions

View File

@ -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,

View File

@ -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}

View File

@ -45,7 +45,7 @@ const useFormContent = (id: string, payload: HumanInputNodeType) => {
})
setInputs(newInputs)
setEditorKey(editorKey => editorKey + 1)
}, [setInputs, editorKey])
}, [setInputs])
return {
editorKey,