Files
vula-8c1f8163/src/components/ui/Input.tsx
T
Vula Builder d42cc66a78 Deploy
2026-07-27 18:59:59 +00:00

28 lines
845 B
TypeScript

'use client'
import { cn } from "@/lib/utils"
import { InputHTMLAttributes, forwardRef } from "react"
interface InputProps extends InputHTMLAttributes<HTMLInputElement> {
error?: boolean
}
const Input = forwardRef<HTMLInputElement, InputProps>(
({ className, error, type = "text", ...props }, ref) => {
return (
<input
type={type}
ref={ref}
className={cn(
"flex h-10 w-full rounded-md border bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus:outline-none focus:border-primary focus:ring-1 focus:ring-primary disabled:cursor-not-allowed disabled:opacity-50",
error ? "border-red-500 focus:border-red-500 focus:ring-red-500" : "border-border",
className
)}
{...props}
/>
)
}
)
Input.displayName = "Input"
export default Input