'use client' import * as React from 'react' import { Search } from 'lucide-react' import { cn } from '@/lib/utils' export interface InputProps extends React.InputHTMLAttributes { label?: string error?: string helper?: string variant?: 'default' | 'search' } const Input = React.forwardRef( ({ className, label, error, helper, variant = 'default', id, ...props }, ref) => { const inputId = id ?? React.useId() const errorId = `${inputId}-error` const helperId = `${inputId}-helper` const describedBy = [ error ? errorId : null, helper ? helperId : null, ] .filter(Boolean) .join(' ') return (
{label && ( )}
{variant === 'search' && (
{error && ( )} {helper && !error && (

{helper}

)}
) } ) Input.displayName = 'Input' export { Input }