autocomplete

This commit is contained in:
Виталий Лавшонок
2025-10-26 07:39:41 +03:00
parent 9c14d766a9
commit 5544fa8b88
3 changed files with 12 additions and 6 deletions

View File

@@ -3,6 +3,7 @@ import { cn } from "../../lib/cn";
import { eyeClosed, eyeOpen } from "../../assets/icons/input";
interface inputProps {
name?: string;
type: "text" | "email" | "password" | "first_name";
error?: string;
disabled?: boolean;
@@ -12,6 +13,7 @@ interface inputProps {
className?: string;
onChange: (state: string) => void;
defaultState?: string;
autocomplete?: string;
}
export const Input: React.FC<inputProps> = ({
@@ -24,6 +26,8 @@ export const Input: React.FC<inputProps> = ({
className = "",
onChange,
defaultState = "",
name = "",
autocomplete="",
}) => {
const [value, setValue] = React.useState<string>(defaultState);
const [visible, setVIsible] = React.useState<boolean>(type != "password");
@@ -47,6 +51,8 @@ export const Input: React.FC<inputProps> = ({
"bg-liquid-lighter w-full rounded-[10px] outline-none pl-[16px] py-[8px] placeholder:text-liquid-light",
type == "password" ? "h-[40px]" : "h-[36px]"
)}
name={name}
autoComplete={autocomplete}
type={type == "password" ? (visible ? "text" : "password") : type}
placeholder={placeholder}
onChange={(e) => {