diff --git a/apps/dashboard/src/components/workflow-editor/steps/digest/digest-key.tsx b/apps/dashboard/src/components/workflow-editor/steps/digest/digest-key.tsx index 767e934b512..bdaefd21f08 100644 --- a/apps/dashboard/src/components/workflow-editor/steps/digest/digest-key.tsx +++ b/apps/dashboard/src/components/workflow-editor/steps/digest/digest-key.tsx @@ -1,13 +1,21 @@ +import { useMemo } from 'react'; import { useFormContext } from 'react-hook-form'; import { RiAccountPinBoxFill } from 'react-icons/ri'; +import { autocompletion } from '@codemirror/autocomplete'; import { FormControl, FormField, FormItem, FormLabel, FormMessage } from '@/components/primitives/form/form'; -import { Input, InputFieldPure } from '@/components/primitives/input'; -import { cn } from '@/utils/ui'; +import { InputFieldPure } from '@/components/primitives/input'; import { Code2 } from '@/components/icons/code-2'; +import { Editor } from '@/components/primitives/editor'; +import { useWorkflow } from '@/components/workflow-editor/workflow-provider'; +import { parseStepVariablesToLiquidVariables } from '@/utils/parseStepVariablesToLiquidVariables'; +import { completions } from '@/utils/liquid-autocomplete'; export const DigestKey = () => { const { control } = useFormContext(); + const { step } = useWorkflow(); + const variables = useMemo(() => (step ? parseStepVariablesToLiquidVariables(step.variables) : []), [step]); + const extensions = useMemo(() => [autocompletion({ override: [completions(variables)] })], [variables]); return ( { Aggregated by - + - subscriberId + subscriberId -