import { PlusIcon, EyeOpenIcon, EyeClosedIcon } from "@radix-ui/react-icons"; import { useState } from "react"; import { cn } from "@/util/utils"; import { Input } from "./ui/input"; import { Popover, PopoverContent, PopoverTrigger } from "./ui/popover"; import { WorkflowBlockParameterSelect } from "@/routes/workflows/editor/nodes/WorkflowBlockParameterSelect"; type Props = Omit, "onChange"> & { onChange: (value: string) => void; nodeId: string; }; function WorkflowBlockInput(props: Props) { const { nodeId, onChange, type, ...inputProps } = props; const [showPassword, setShowPassword] = useState(false); const isPasswordField = type === "password"; const actualType = isPasswordField && showPassword ? "text" : type; return (
{ onChange(event.target.value); }} />
{isPasswordField && (
setShowPassword(!showPassword)} > {showPassword ? ( ) : ( )}
)}
{ onChange(`${props.value ?? ""}{{${parameterKey}}}`); }} />
); } export { WorkflowBlockInput };