import React from 'react'; import styles from './CredentialInput.module.css'; import { isValueEncrypted } from '@aiostreams/utils'; interface CredentialInputProps { credential: string; setCredential: (credential: string) => void; inputProps?: React.InputHTMLAttributes; } const CredentialInput: React.FC = ({ credential, setCredential, inputProps = {}, }) => { const [showPassword, setShowPassword] = React.useState(false); return (
setCredential(e.target.value.trim())} className={styles.credentialInput} {...inputProps} disabled={ isValueEncrypted(credential) ? true : inputProps.disabled || false } /> {!isValueEncrypted(credential) && ( )} {isValueEncrypted(credential) && ( )}
); }; export default CredentialInput;