"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const react_1 = tslib_1.__importStar(require("react"));
const Floating_style_1 = tslib_1.__importDefault(require("../Floating.style"));
const index_1 = tslib_1.__importDefault(require("../index"));
const PasswordInput = (props) => {
    const [hidePassword, setHidePassword] = (0, react_1.useState)(true);
    const hitSlop = {
        left: 25,
        right: 25,
        top: 25,
        bottom: 25,
    };
    const onPressShowPassword = (0, react_1.useCallback)(() => {
        setHidePassword(!hidePassword);
    }, [hidePassword]);
    return props.isFloating ? (<Floating_style_1.default secureTextEntry={hidePassword} rightIconName={hidePassword ? 'eye' : 'eye-slash'} iconTouchableEnabled onPressIcon={onPressShowPassword} onRightIconPress={onPressShowPassword} iconHitSlop={hitSlop} textContentType="password" {...props}/>) : (<index_1.default secureTextEntry={hidePassword} rightIconName={hidePassword ? 'eye' : 'eye-slash'} iconTouchableEnabled onPressIcon={onPressShowPassword} onRightIconPress={onPressShowPassword} iconHitSlop={hitSlop} textContentType="password" {...props}/>);
};
exports.default = PasswordInput;
//# sourceMappingURL=index.js.map