import { forwardRef } from "react";

/**
 * Textarea
 *
 * ghost:   boolean - removes border/background
 * invalid: boolean - applies invalid state
 */
const Textarea = forwardRef(function Textarea(
  { ghost = false, invalid = false, className = "", ...props },
  ref
) {
  const classes = [
    "prs-input",
    "prs-textarea",
    ghost && "prs-input-ghost",
    invalid && "prs-input_invalid",
    className,
  ]
    .filter(Boolean)
    .join(" ");

  return <textarea ref={ref} className={classes} {...props} />;
});

export default Textarea;
