diff --git a/ui/components/providers/workflow/forms/via-credentials/k8s-credentials-form.tsx b/ui/components/providers/workflow/forms/via-credentials/k8s-credentials-form.tsx index 0725d134eb..3e6caeca88 100644 --- a/ui/components/providers/workflow/forms/via-credentials/k8s-credentials-form.tsx +++ b/ui/components/providers/workflow/forms/via-credentials/k8s-credentials-form.tsx @@ -1,6 +1,6 @@ import { Control } from "react-hook-form"; -import { CustomInput } from "@/components/ui/custom"; +import { CustomTextarea } from "@/components/ui/custom"; import { KubernetesCredentials } from "@/types"; export const KubernetesCredentialsForm = ({ @@ -15,17 +15,17 @@ export const KubernetesCredentialsForm = ({ Connect via Credentials
- Please provide the information for your Kubernetes credentials. + Please provide the kubeconfig content for your Kubernetes credentials.
- diff --git a/ui/components/ui/custom/custom-textarea.tsx b/ui/components/ui/custom/custom-textarea.tsx new file mode 100644 index 0000000000..c3f6dc0994 --- /dev/null +++ b/ui/components/ui/custom/custom-textarea.tsx @@ -0,0 +1,74 @@ +"use client"; + +import { Textarea } from "@nextui-org/input"; +import React from "react"; +import { Control, FieldPath, FieldValues } from "react-hook-form"; + +import { FormControl, FormField, FormMessage } from "@/components/ui/form"; + +interface CustomTextareaProps { + control: Control; + name: FieldPath; + label?: string; + labelPlacement?: "inside" | "outside" | "outside-left"; + variant?: "flat" | "bordered" | "underlined" | "faded"; + size?: "sm" | "md" | "lg"; + placeholder?: string; + defaultValue?: string; + isRequired?: boolean; + isInvalid?: boolean; + minRows?: number; + maxRows?: number; + fullWidth?: boolean; + disableAutosize?: boolean; + description?: React.ReactNode; +} + +export const CustomTextarea = ({ + control, + name, + label = name, + labelPlacement = "inside", + placeholder, + variant = "flat", + size = "md", + defaultValue, + isRequired = false, + isInvalid = false, + minRows = 3, + maxRows = 8, + fullWidth = true, + disableAutosize = false, + description, +}: CustomTextareaProps) => { + return ( + ( + <> + +