import React, { forwardRef, useState } from 'react'; import { Clickable } from '../Clickable'; import { Input, FieldProps } from '../Field'; import { Text } from '../Text'; import './PasswordInput.scss'; export type PasswordInputProps = FieldProps; export const PasswordInput = forwardRef( ({ ...rest }: PasswordInputProps, ref: React.Ref) => { const [passwordShown, setPasswordShown] = useState(false); const togglePasswordVisiblity = () => { setPasswordShown(passwordShown ? false : true); }; return (
{passwordShown ? ( HIDE ) : ( SHOW )}
); } ); PasswordInput.displayName = 'PasswordInput';