'use client'; import { Input } from '@/components/ui/input'; import { Textarea } from '@/components/ui/textarea'; import { Label } from '@/components/ui/label'; import { cn } from '@/lib/utils'; export interface TextInputProps { label: string; value?: string; defaultValue?: string; onChange: (value: string) => void; type?: 'text' | 'email' | 'password' | 'url' | 'tel'; className?: string; disabled?: boolean; placeholder?: string; helpText?: string; required?: boolean; maxLength?: number; minLength?: number; pattern?: string; isTextarea?: boolean; rows?: number; } export default function TextInput({ label, value, defaultValue = '', onChange, type = 'text', className = '', disabled = false, placeholder, helpText, required = false, maxLength, minLength, pattern, isTextarea = false, rows = 3, }: TextInputProps) { const currentValue = value ?? defaultValue; return (
{isTextarea ? (