You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
764 B
35 lines
764 B
import React from "react"; |
|
|
|
function Input({ |
|
type = "text", |
|
inputMode = "text", |
|
value, |
|
maxLength, |
|
regex, |
|
onChange, |
|
name, |
|
align, |
|
direction, |
|
placeholder, |
|
}) { |
|
return ( |
|
<input |
|
name={name} |
|
type={type} |
|
inputMode={inputMode} |
|
value={value} |
|
placeholder={placeholder} |
|
maxLength={maxLength} |
|
onChange={(e) => |
|
onChange(e.target.name, (e.target.value = regex(e.target.value))) |
|
} |
|
className={`w-full outline-none border border-solid border-gray-200 focus:border-primary-7 focus:bg-secondary-9 bg-gray-50 rounded-lg placeholder:text-gray-400 focus:text-secondary-8 text-2x p-6 font-2`} |
|
style={{ |
|
direction, |
|
textAlign: align, |
|
}} |
|
/> |
|
); |
|
} |
|
|
|
export default Input;
|
|
|