import * as React from "react"; // types import { Props } from "./types"; export const Input: React.FC = ({ label, value, name, register, validations, error, mode = "primary", onChange, className = "", type, id, size = "rg", fullWidth = true, ...rest }) => ( <> {label && ( )} { register && register(name).onChange(e); onChange && onChange(e); }} className={`block rounded-md bg-transparent text-sm focus:outline-none placeholder-custom-text-400 ${ mode === "primary" ? "rounded-md border border-custom-border-100" : mode === "transparent" ? "rounded border-none bg-transparent ring-0 transition-all focus:ring-1 focus:ring-custom-primary" : mode === "trueTransparent" ? "rounded border-none bg-transparent ring-0" : "" } ${error ? "border-red-500" : ""} ${error && mode === "primary" ? "bg-red-500/20" : ""} ${ fullWidth ? "w-full" : "" } ${size === "rg" ? "px-3 py-2" : size === "lg" ? "p-3" : ""} ${className}`} {...rest} /> {error?.message &&
{error.message}
} );