From 442f70c58ea36399abfaa22676533f0bc49eb0f0 Mon Sep 17 00:00:00 2001 From: Shuchang Zheng Date: Mon, 21 Oct 2024 09:29:49 -0700 Subject: [PATCH] Change appearance of parameters in task details (#1017) --- .../AutoResizingTextarea.tsx | 25 ++- .../src/routes/tasks/detail/TaskDetails.tsx | 4 +- .../routes/tasks/detail/TaskParameters.tsx | 157 +++++++++--------- .../src/routes/workflows/WorkflowRun.tsx | 2 +- .../workflows/components/CodeEditor.tsx | 6 +- 5 files changed, 106 insertions(+), 88 deletions(-) diff --git a/skyvern-frontend/src/components/AutoResizingTextarea/AutoResizingTextarea.tsx b/skyvern-frontend/src/components/AutoResizingTextarea/AutoResizingTextarea.tsx index a252ef07..5900f961 100644 --- a/skyvern-frontend/src/components/AutoResizingTextarea/AutoResizingTextarea.tsx +++ b/skyvern-frontend/src/components/AutoResizingTextarea/AutoResizingTextarea.tsx @@ -1,10 +1,22 @@ -import { useLayoutEffect, useRef } from "react"; +import { ChangeEventHandler, useLayoutEffect, useRef } from "react"; import { Textarea } from "@/components/ui/textarea"; import { cn } from "@/util/utils"; -type Props = React.ComponentPropsWithoutRef; +type Props = { + value: string; + onChange?: ChangeEventHandler; + className?: string; + readOnly?: boolean; + placeholder?: string; +}; -function AutoResizingTextarea(props: Props) { +function AutoResizingTextarea({ + value, + onChange, + className, + readOnly, + placeholder, +}: Props) { const ref = useRef(null); useLayoutEffect(() => { @@ -25,12 +37,15 @@ function AutoResizingTextarea(props: Props) { return (