9 lines
495 B
JavaScript
9 lines
495 B
JavaScript
export default function Input({ error, onChange, id, label, className, placeholder=null, value }) {
|
|
return (
|
|
<div className={"flex flex-col" + " " + className}>
|
|
<label className="pr-3 pb-0.5">{ label }</label>
|
|
<input onChange={ onChange } id={id} type="text" className="w-full border-gray-300 rounded-lg" placeholder={placeholder} value={value}/>
|
|
{error && <span className="text-sm text-red-600 pt-0.5 pr-3">{error}</span>}
|
|
</div>
|
|
);
|
|
} |