This commit is contained in:
Vula Builder
2026-07-27 18:34:57 +00:00
parent 7e858e4186
commit 523398193e
+26
View File
@@ -0,0 +1,26 @@
'use client'
import { cn } from "@/lib/utils"
interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {
error?: string
}
export default function Input({ className, error, ...props }: InputProps) {
return (
<div className="flex flex-col">
<input
className={cn(
"flex h-10 w-full rounded-md border border-border bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus:outline-none focus:border-primary disabled:cursor-not-allowed disabled:opacity-50",
error && "border-accent focus:border-accent",
className
)}
aria-invalid={!!error}
{...props}
/>
{error && (
<p className="mt-1 text-sm text-accent">{error}</p>
)}
</div>
)
}