import { forwardRef, type TextareaHTMLAttributes } from "react";
import { radiusClass, type Radius } from "./radius";

type TextareaProps = TextareaHTMLAttributes<HTMLTextAreaElement> & {
  radius?: Radius;
};

const Textarea = forwardRef<HTMLTextAreaElement, TextareaProps>(
  ({ radius = "lg", className = "", ...props }, ref) => {
    return <textarea ref={ref} className={`${radiusClass(radius)} ${className}`.trim()} {...props} />;
  }
);

Textarea.displayName = "Textarea";

export default Textarea;
