From 0313f24a8364f29f29c145f24adda8f4432c09f0 Mon Sep 17 00:00:00 2001 From: Emir Karabeg Date: Thu, 16 Jan 2025 12:53:33 -0800 Subject: [PATCH] State works without subblock state --- .../sub-block/components/dropdown.tsx | 9 +++++++- .../sub-block/components/long-input.tsx | 8 ++++++- .../sub-block/components/short-input.tsx | 9 +++++++- .../sub-block/components/slider-input.tsx | 4 ++++ .../sub-block/hooks/use-sub-block-value.ts | 23 +++++++++++++++++++ .../workflow-block/sub-block/sub-block.tsx | 21 ++++++++++++++--- .../workflow-block/workflow-block.tsx | 2 +- stores/workflow/types.ts | 6 ++--- stores/workflow/workflow-store.ts | 23 ++++++++++++------- 9 files changed, 87 insertions(+), 18 deletions(-) create mode 100644 app/w/components/workflow-block/sub-block/hooks/use-sub-block-value.ts diff --git a/app/w/components/workflow-block/sub-block/components/dropdown.tsx b/app/w/components/workflow-block/sub-block/components/dropdown.tsx index de2458867b..caf4b10200 100644 --- a/app/w/components/workflow-block/sub-block/components/dropdown.tsx +++ b/app/w/components/workflow-block/sub-block/components/dropdown.tsx @@ -9,9 +9,16 @@ import { interface DropdownProps { options: string[] defaultValue?: string + blockId: string + subBlockId: string } -export function Dropdown({ options, defaultValue }: DropdownProps) { +export function Dropdown({ + options, + defaultValue, + blockId, + subBlockId, +}: DropdownProps) { return (