Settings
{entries.map(([key, property]) => {
const value = params[key] ?? property.default ?? ""
const label = property.title ?? key
if (property.type === "boolean") {
return (
set(key, checked)}
/>
)
}
if (property.type === "object" || property.type === "array") {
return null
}
const numeric =
property.type === "integer" || property.type === "number"
return (
set(
key,
numeric ? Number(event.target.value) : event.target.value,
)
}
/>
)
})}
)
}
function PanelBody({
node,
flow,
nodeType,
suggestions,
expanded,
onChange,
onSaveSource,
onToggleExpand,
}: {
node: NodeDef_Input
flow: string
nodeType: NodeTypeInfo | undefined
suggestions: PortSuggestions
expanded: boolean
onChange: (next: NodeDef_Input) => void
onSaveSource: (code: string) => void
onToggleExpand: () => void
}) {
const hasSource = nodeType?.has_source ?? node.type === "python"
const { data: source } = useQuery({
...nodeSourceQueryOptions(flow, node.id),
enabled: hasSource,
})
const [code, setCode] = useState