"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.MenuButtonLegacyE2ETest = void 0;
const tslib_1 = require("tslib");
const React = tslib_1.__importStar(require("react"));
const react_native_1 = require("react-native");
const react_native_2 = require("@fluentui/react-native");
const e2e_testing_1 = require("@fluentui-react-native/e2e-testing");
const MenuButtonLegacyTestStyles_1 = require("./MenuButtonLegacyTestStyles");
const testData_1 = require("./testData");
const TestProps_1 = require("../Common/TestProps");
const MenuButtonLegacyE2ETest = () => {
    const [lastMenuItemClicked, setLastMenuItemClicked] = React.useState(null);
    const onItemClick = React.useCallback((key) => {
        setLastMenuItemClicked(key);
    }, [setLastMenuItemClicked]);
    const 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: { ...MenuButtonLegacyTestStyles_1.rowStyle, paddingHorizontal: 5 } },
                    React.createElement(react_native_1.View, { style: MenuButtonLegacyTestStyles_1.columnStyle },
                        React.createElement(react_native_2.MenuButton, { content: "Standard MenuButton with Accessibility Label", menuItems: testData_1.menuItems, onItemClick: onItemClick, contextualMenu: contextualMenuProps, accessibilityLabel: e2e_testing_1.MENU_BUTTON_ACCESSIBILITY_LABEL, ...(0, TestProps_1.testProps)(e2e_testing_1.MENU_BUTTON_TEST_COMPONENT) }))),
                React.createElement(react_native_1.View, { style: { ...MenuButtonLegacyTestStyles_1.rowStyle, paddingHorizontal: 5 } },
                    React.createElement(react_native_1.View, { style: MenuButtonLegacyTestStyles_1.columnStyle },
                        React.createElement(react_native_2.MenuButton, { content: e2e_testing_1.MENU_BUTTON_TEST_COMPONENT_LABEL, menuItems: testData_1.menuItems, onItemClick: onItemClick, contextualMenu: contextualMenuProps, ...(0, TestProps_1.testProps)(e2e_testing_1.MENU_BUTTON_NO_A11Y_LABEL_COMPONENT) })))))));
};
exports.MenuButtonLegacyE2ETest = MenuButtonLegacyE2ETest;
//# sourceMappingURL=MenuButtonLegacyE2ETest.js.map