/** * Copyright (c) 2023-present Plane Software, Inc. and contributors * SPDX-License-Identifier: AGPL-3.0-only * See the LICENSE file for details. */ import React, { useRef } from "react"; // helpers import { useAutoResizeTextArea } from "../hooks/use-auto-resize-textarea"; import { cn } from "../utils"; // hooks export interface TextAreaProps extends React.TextareaHTMLAttributes { mode?: "primary" | "transparent" | "true-transparent"; textAreaSize?: "xs" | "sm" | "md"; hasError?: boolean; className?: string; } const TextArea = React.forwardRef(function TextArea( props: TextAreaProps, ref: React.ForwardedRef ) { const { id, name, value = "", mode = "primary", textAreaSize = "sm", hasError = false, className = "", ...rest } = props; // refs const textAreaRef = useRef(ref); // auto re-size useAutoResizeTextArea(textAreaRef, value); return (