"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.E2ESwitchTest = void 0;
var tslib_1 = require("tslib");
var React = tslib_1.__importStar(require("react"));
var react_native_1 = require("react-native");
var stack_1 = require("@fluentui-react-native/stack");
var switch_1 = require("@fluentui-react-native/switch");
var text_1 = require("@fluentui-react-native/text");
var consts_1 = require("../../../../E2E/src/Switch/consts");
var styles_1 = require("../Common/styles");
var TestProps_1 = require("../Common/TestProps");
var E2ESwitchTest = function () {
    var _a = React.useState(false), switchPressed = _a[0], setSwitchSwitchPressed = _a[1];
    var memoizedStyles = React.useMemo(function () { return (react_native_1.Platform.OS === 'android' ? tslib_1.__assign(tslib_1.__assign({}, styles_1.commonTestStyles.androidContainer), { height: 100, marginBottom: 50 }) : styles_1.stackStyle); }, []);
    var onToggle = React.useCallback(function (_e, checked) {
        setSwitchSwitchPressed(checked);
    }, [setSwitchSwitchPressed]);
    return (React.createElement(stack_1.Stack, { style: memoizedStyles },
        React.createElement(switch_1.Switch, tslib_1.__assign({ label: 'Switch Test', onChange: onToggle, accessibilityLabel: consts_1.SWITCH_ACCESSIBILITY_LABEL }, (0, TestProps_1.testProps)(consts_1.SWITCH_TEST_COMPONENT))),
        switchPressed ? (React.createElement(text_1.TextV1
        /* For Android E2E testing purposes, testProps must be passed in after accessibilityLabel. */
        , tslib_1.__assign({}, (0, TestProps_1.testProps)(consts_1.SWITCH_ON_PRESS)), "Switch Toggled On")) : null,
        React.createElement(switch_1.Switch, tslib_1.__assign({ label: consts_1.SWITCH_TEST_COMPONENT_LABEL }, (0, TestProps_1.testProps)(consts_1.SWITCH_NO_A11Y_LABEL_COMPONENT)))));
};
exports.E2ESwitchTest = E2ESwitchTest;
//# sourceMappingURL=E2ESwitchTest.js.map