edit interface TS

This commit is contained in:
p2405951
2026-03-13 14:23:09 +01:00
parent 4c7b636f27
commit 664ebf1e52
7 changed files with 14 additions and 91 deletions
+13 -11
View File
@@ -11,14 +11,14 @@ interface TextInputProps extends InputHTMLAttributes<HTMLInputElement> {
}
const TextInput = ({
placeholder,
onChange,
value,
borderStyle = "square",
password,
className = "",
...props
}: TextInputProps) => {
placeholder = "",
onChange,
value = "",
borderStyle = "square",
password = false,
className = "",
...props
}: TextInputProps) => {
const [showPassword, setShowPassword] = useState<boolean>(false);
let inputBorderStyle = styles.square;
@@ -28,15 +28,16 @@ const TextInput = ({
setShowPassword((prev) => !prev);
};
if (password)
if (password) {
return (
<div className={styles.passwordContainer}>
<TextInput
<input
type={showPassword ? "text" : "password"}
value={value}
placeholder={placeholder}
onChange={onChange}
className={styles.passwordInput}
className={`${styles.input} ${styles.passwordInput} ${inputBorderStyle} ${className}`}
{...props}
/>
<button
type="button"
@@ -47,6 +48,7 @@ const TextInput = ({
</button>
</div>
);
}
return (
<input