From e4ed54a7c07d84de6b1404aa283e575a7b1667ba Mon Sep 17 00:00:00 2001 From: karishmas6 Date: Fri, 13 Sep 2024 23:26:24 +0530 Subject: [PATCH] feat: implement updateListTextFieldLabel --- src/context/browserSteps.tsx | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/context/browserSteps.tsx b/src/context/browserSteps.tsx index b3ed2b0a..badf5e5c 100644 --- a/src/context/browserSteps.tsx +++ b/src/context/browserSteps.tsx @@ -102,6 +102,26 @@ export const BrowserStepsProvider: React.FC<{ children: React.ReactNode }> = ({ ); }; + const updateListTextFieldLabel = (listId: number, fieldKey: string, newLabel: string) => { + setBrowserSteps(prevSteps => + prevSteps.map(step => { + if (step.type === 'list' && step.id === listId) { + return { + ...step, + fields: { + ...step.fields, + [fieldKey]: { + ...step.fields[fieldKey], + label: newLabel + } + } + }; + } + return step; + }) + ); + }; + return (