structure
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
import { FC, InputHTMLAttributes } from 'react'
|
||||
import { clx } from '../helpers/utils';
|
||||
|
||||
type Variant = "floating_outlined" | "primary" | "search";
|
||||
|
||||
type Props = {
|
||||
label: string;
|
||||
className?: string;
|
||||
variant?: Variant;
|
||||
error_text?: string;
|
||||
onEnter?: () => void;
|
||||
unit?: string;
|
||||
seprator?: boolean;
|
||||
isNotRequired?: boolean;
|
||||
} & InputHTMLAttributes<HTMLInputElement>
|
||||
|
||||
const Input: FC<Props> = (props: Props) => {
|
||||
|
||||
const inputClass = clx(
|
||||
'w-full h-12 text-black block px-4 rounded-xl mt-2 border border-border',
|
||||
props.readOnly && 'bg-gray-100',
|
||||
props.className
|
||||
);
|
||||
|
||||
return (
|
||||
<div className='w-full'>
|
||||
<label className='text-sm'>
|
||||
{props.label}
|
||||
</label>
|
||||
|
||||
<input {...props} className={inputClass} />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default Input
|
||||
Reference in New Issue
Block a user