Deploy
This commit is contained in:
@@ -0,0 +1,28 @@
|
|||||||
|
'use client'
|
||||||
|
|
||||||
|
import React from 'react'
|
||||||
|
import { cn } from "@/lib/utils"
|
||||||
|
|
||||||
|
interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
||||||
|
error?: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export default function Input({ className, error, ...props }: InputProps) {
|
||||||
|
return (
|
||||||
|
<div className="relative">
|
||||||
|
<input
|
||||||
|
className={cn(
|
||||||
|
"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 focus:ring-1 focus:ring-primary",
|
||||||
|
"disabled:cursor-not-allowed disabled:opacity-50",
|
||||||
|
error && "border-destructive focus:border-destructive focus:ring-destructive",
|
||||||
|
className
|
||||||
|
)}
|
||||||
|
{...props}
|
||||||
|
/>
|
||||||
|
{error && (
|
||||||
|
<p className="mt-1 text-sm text-destructive">{error}</p>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user