import { forwardRef } from "react";

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

  return <input ref={ref} type="file" className={classes} {...props} />;
});

export default File;
