import { __assign } from "tslib";
import * as React from 'react';
import { Platform } from 'react-native';
import { Stack } from '@fluentui-react-native/stack';
import { Switch } from '@fluentui-react-native/switch';
import { TextV1 } from '@fluentui-react-native/text';
import { SWITCH_TEST_COMPONENT, SWITCH_ACCESSIBILITY_LABEL, SWITCH_NO_A11Y_LABEL_COMPONENT, SWITCH_TEST_COMPONENT_LABEL, SWITCH_ON_PRESS, } from '../../../../E2E/src/Switch/consts';
import { stackStyle, commonTestStyles } from '../Common/styles';
import { testProps } from '../Common/TestProps';
export var E2ESwitchTest = function () {
    var _a = React.useState(false), switchPressed = _a[0], setSwitchSwitchPressed = _a[1];
    var memoizedStyles = React.useMemo(function () { return (Platform.OS === 'android' ? __assign(__assign({}, commonTestStyles.androidContainer), { height: 100, marginBottom: 50 }) : stackStyle); }, []);
    var onToggle = React.useCallback(function (_e, checked) {
        setSwitchSwitchPressed(checked);
    }, [setSwitchSwitchPressed]);
    return (React.createElement(Stack, { style: memoizedStyles },
        React.createElement(Switch, __assign({ label: 'Switch Test', onChange: onToggle, accessibilityLabel: SWITCH_ACCESSIBILITY_LABEL }, testProps(SWITCH_TEST_COMPONENT))),
        switchPressed ? (React.createElement(TextV1
        /* For Android E2E testing purposes, testProps must be passed in after accessibilityLabel. */
        , __assign({}, testProps(SWITCH_ON_PRESS)), "Switch Toggled On")) : null,
        React.createElement(Switch, __assign({ label: SWITCH_TEST_COMPONENT_LABEL }, testProps(SWITCH_NO_A11Y_LABEL_COMPONENT)))));
};
//# sourceMappingURL=E2ESwitchTest.js.map