import * as React from 'react'; import { useLayoutEffect, useRef } from 'react'; import { cn } from '@/lib/utils'; export interface InputProps extends React.InputHTMLAttributes {} const Input = React.forwardRef(({ className, type, ...props }, ref) => { const inputRef = useRef(); const handleRef = (element: HTMLInputElement) => { if (!element) return; inputRef.current = element; if (!ref) return; typeof ref === 'function' ? ref(element) : (ref.current = element); }; useLayoutEffect(() => { if (!inputRef.current || props.autoFocus) return; setTimeout(() => inputRef.current?.blur()); }, [props.autoFocus]); return ( ); }); Input.displayName = 'Input'; export { Input };