import React from "react"; import { cn } from "../utils"; type InputProps = React.DetailedHTMLProps< React.InputHTMLAttributes, HTMLInputElement > & { className?: string; onEnter?: () => void; whiteBg?: boolean; noNeedKeyupEnter?: boolean; onKeyUp?: (e: any) => void; }; const Input = React.forwardRef(function Input( { className, ...props }: InputProps, ref, ) { return ( ); }); export default Input; export const InputBase = React.forwardRef(function InputBase( { className, onEnter, whiteBg, ...props }: InputProps, ref, ) { return ( } onKeyUp={(e) => { if (props?.noNeedKeyupEnter) { return false; } else { if (onEnter && e.key === "Enter") { onEnter(); } return props.onKeyUp?.(e); } }} /> ); });