import { forwardRef, useMemo } from "react"; import { cn } from "../../utils/bem"; import Label from "../Label/Label"; import "./Input.prefix.css"; const Input = forwardRef(({ label, className, required, labelProps, ghost, waiting, ...props }, ref) => { const rootClass = cn("input"); const classList = [rootClass.mod({ ghost }), className].join(" ").trim(); const input = useMemo(() => { return waiting ? (
) : ( ); }, [props, ref, classList, waiting]); return label ? ( ) : ( input ); }); Input.displayName = "Input"; export default Input;