import * as React from 'react'; import { cn } from '@/lib/utils'; import { useId } from 'react'; export interface FloatingInputProps extends React.InputHTMLAttributes { label: string; error?: string; icon?: React.ReactNode; } const FloatingInput = React.forwardRef( ({ className, label, error, icon, type, id, ...props }, ref) => { const generatedId = useId(); const inputId = id || generatedId; return (
{/* Icon */} {icon && (
{icon}
)} {/* Floating Label */}
{/* Error Message */} {error && (

{error}

)}
); } ); FloatingInput.displayName = 'FloatingInput'; export { FloatingInput };