File size: 940 Bytes
f5071ca |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
import { forwardRef } from "react";
import { twMerge } from "tailwind-merge"
export interface InputProps
extends React.InputHTMLAttributes<HTMLInputElement> {}
const Input = forwardRef<HTMLInputElement, InputProps>(({
className,
type,
disabled,
...props
}, ref) => {
return (
<input
type={type}
className={twMerge(
`
flex
w-full
rounded-md
bg-neutral-700
border
border-transparent
px-3
py-3
text-sm
file:border-0
file:bg-transparent
file:text-sm
file:font-medium
placeholder:text-neutral-400
disabled:cursor-not-allowed
disabled:opacity-50
focus:outline-none
`,
disabled && 'opacity-75',
className
)}
disabled={disabled}
ref={ref}
{...props}
/>
)
});
Input.displayName = "Input";
export default Input |