This commit is contained in:
Vula Builder
2026-06-27 09:51:14 +00:00
parent e60addef26
commit 3b0167c106
+27
View File
@@ -0,0 +1,27 @@
'use client'
import { cn } from "@/lib/utils"
interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {
label?: string
error?: string
}
export default function Input({ label, error, className, ...props }: InputProps) {
return (
<div className="w-full">
{label && (
<label className="block mb-1 text-sm font-medium text-[#1B3A1F]">{label}</label>
)}
<input
className={cn(
"w-full rounded-lg border border-[#e5e7eb] bg-white px-3 py-2 text-[#1B3A1F] placeholder:text-[#1B3A1F]/40 focus:outline-none focus:border-[#2E7D32] focus:ring-2 focus:ring-[#2E7D32]/20 transition-colors duration-200",
error && "border-red-500 focus:border-red-500 focus:ring-red-500/20",
className
)}
{...props}
/>
{error && <p className="mt-1 text-sm text-red-600">{error}</p>}
</div>
)
}