'use client' import type { SVGProps } from 'react' import React, { useState } from 'react' import { useTranslation } from 'react-i18next' import cn from 'classnames' type InputProps = { placeholder?: string value?: string defaultValue?: string onChange?: (v: string) => void className?: string wrapperClassName?: string type?: string showPrefix?: React.ReactNode prefixIcon?: React.ReactNode } const GlassIcon = ({ className }: SVGProps) => ( ) const Input = ({ value, defaultValue, onChange, className = '', wrapperClassName = '', placeholder, type, showPrefix, prefixIcon }: InputProps) => { const [localValue, setLocalValue] = useState(value ?? defaultValue) const { t } = useTranslation() return (
{showPrefix && {prefixIcon ?? }} { setLocalValue(e.target.value) onChange && onChange(e.target.value) }} />
) } export default Input