30 lines
717 B
JavaScript
30 lines
717 B
JavaScript
'use client';
|
|
|
|
export default function FormInput({
|
|
label,
|
|
value,
|
|
onChange,
|
|
placeholder,
|
|
type = "text",
|
|
required = false,
|
|
helperText ,
|
|
styleEl=''
|
|
}) {
|
|
return (
|
|
<div>
|
|
<label className="block text-sm font-medium text-gray-700 mb-1">
|
|
{label}{required && '*'}
|
|
</label>
|
|
<input
|
|
type={type}
|
|
placeholder={placeholder}
|
|
value={value}
|
|
onChange={(e) => onChange(e.target.value)}
|
|
className={`${styleEl} w-full px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-teal-500 `}
|
|
/>
|
|
{helperText && (
|
|
<p className="text-xs text-gray-500 mt-1">{helperText}</p>
|
|
)}
|
|
</div>
|
|
);
|
|
} |