"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.MenuButtonLegacyE2ETest = void 0;
var tslib_1 = require("tslib");
var React = tslib_1.__importStar(require("react"));
var react_native_1 = require("react-native");
var react_native_2 = require("@fluentui/react-native");
var MenuButtonLegacyTestStyles_1 = require("./MenuButtonLegacyTestStyles");
var testData_1 = require("./testData");
var consts_1 = require("../../../../E2E/src/MenuButtonLegacy/consts");
var TestProps_1 = require("../Common/TestProps");
var MenuButtonLegacyE2ETest = function () {
    var _a = React.useState(null), lastMenuItemClicked = _a[0], setLastMenuItemClicked = _a[1];
    var onItemClick = React.useCallback(function (key) {
        setLastMenuItemClicked(key);
    }, [setLastMenuItemClicked]);
    var contextualMenuProps = {
        accessibilityLabel: 'MenuButton',
        shouldFocusOnMount: true,
        shouldFocusOnContainer: false,
    };
    return (React.createElement(react_native_1.View, null,
        React.createElement(react_native_1.View, { style: MenuButtonLegacyTestStyles_1.viewWrapperStyle },
            React.createElement(react_native_1.View, { style: MenuButtonLegacyTestStyles_1.columnStyle },
                React.createElement(react_native_1.Text, null,
                    React.createElement(react_native_1.Text, null, "Last Menu Item Clicked: "),
                    lastMenuItemClicked > 0 ? React.createElement(react_native_1.Text, { style: MenuButtonLegacyTestStyles_1.textColor }, lastMenuItemClicked) : React.createElement(react_native_1.Text, { style: MenuButtonLegacyTestStyles_1.textColor }, "none")),
                React.createElement(react_native_1.View, { style: tslib_1.__assign(tslib_1.__assign({}, MenuButtonLegacyTestStyles_1.rowStyle), { paddingHorizontal: 5 }) },
                    React.createElement(react_native_1.View, { style: MenuButtonLegacyTestStyles_1.columnStyle },
                        React.createElement(react_native_2.MenuButton, tslib_1.__assign({ content: "Standard MenuButton with Accessibility Label", menuItems: testData_1.menuItems, onItemClick: onItemClick, contextualMenu: contextualMenuProps, accessibilityLabel: consts_1.MENU_BUTTON_ACCESSIBILITY_LABEL }, (0, TestProps_1.testProps)(consts_1.MENU_BUTTON_TEST_COMPONENT))))),
                React.createElement(react_native_1.View, { style: tslib_1.__assign(tslib_1.__assign({}, MenuButtonLegacyTestStyles_1.rowStyle), { paddingHorizontal: 5 }) },
                    React.createElement(react_native_1.View, { style: MenuButtonLegacyTestStyles_1.columnStyle },
                        React.createElement(react_native_2.MenuButton, tslib_1.__assign({ content: consts_1.MENU_BUTTON_TEST_COMPONENT_LABEL, menuItems: testData_1.menuItems, onItemClick: onItemClick, contextualMenu: contextualMenuProps }, (0, TestProps_1.testProps)(consts_1.MENU_BUTTON_NO_A11Y_LABEL_COMPONENT)))))))));
};
exports.MenuButtonLegacyE2ETest = MenuButtonLegacyE2ETest;
//# sourceMappingURL=MenuButtonLegacyE2ETest.js.map