This commit is contained in:
Vula Builder
2026-07-28 12:39:42 +00:00
parent d38c6aa338
commit 2d82da9c03
+30
View File
@@ -0,0 +1,30 @@
'use client'
import { cn } from "@/lib/utils"
import React from "react"
interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {
error?: string
}
export default function Input({
className,
error,
...props
}: InputProps) {
return (
<div className="w-full">
<input
className={cn(
"flex h-10 w-full rounded-md border border-border bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus:outline-none focus:border-primary disabled:cursor-not-allowed disabled:opacity-50",
error && "border-accent"
)}
aria-invalid={error ? "true" : undefined}
{...props}
/>
{error && (
<p className="mt-1 text-sm text-accent">{error}</p>
)}
</div>
)
}