import { __assign } from "tslib";
import * as React from 'react';
import { Text, View, Switch, Platform } from 'react-native';
import { Separator } from '@fluentui/react-native';
import { MenuButton } from '@fluentui-react-native/experimental-menu-button';
import { viewWrapperStyle, columnStyle, rowStyle, textColor } from './MenuButtonV1TestStyles';
import { menuItems, iconProps } from './testData';
import { testImage } from '../Common/iconExamples';
export var StandardMenuButton = function () {
    var _a = React.useState(null), lastMenuItemClicked = _a[0], setLastMenuItemClicked = _a[1];
    var _b = React.useState(true), focusOnMount = _b[0], setShouldFocusOnMount = _b[1];
    var toggleFocusOnMount = React.useCallback(function (value) { return setShouldFocusOnMount(value); }, [setShouldFocusOnMount]);
    var _c = React.useState(false), focusOnContainer = _c[0], setShouldFocusOnContainer = _c[1];
    var toggleFocusOnContainer = React.useCallback(function (value) { return setShouldFocusOnContainer(value); }, [setShouldFocusOnContainer]);
    var onItemClick = React.useCallback(function (key) {
        setLastMenuItemClicked(key);
    }, [setLastMenuItemClicked]);
    var contextualMenuProps = {
        accessibilityLabel: 'MenuButton',
        shouldFocusOnMount: focusOnMount,
        shouldFocusOnContainer: focusOnContainer,
    };
    var iconToShow = Platform.select({
        macos: testImage,
        default: iconProps,
    });
    return (React.createElement(View, null,
        React.createElement(View, { style: viewWrapperStyle },
            React.createElement(View, { style: columnStyle },
                React.createElement(View, { style: rowStyle },
                    React.createElement(Text, null, "Should Focus on Mount"),
                    React.createElement(Switch, { value: focusOnMount, onValueChange: toggleFocusOnMount })),
                React.createElement(View, { style: rowStyle },
                    React.createElement(Text, null, "Should Focus on Container"),
                    React.createElement(Switch, { value: focusOnContainer, onValueChange: toggleFocusOnContainer }))),
            React.createElement(Separator, { vertical: true }),
            React.createElement(View, { style: columnStyle },
                React.createElement(Text, null,
                    React.createElement(Text, null, "Last Menu Item Clicked: "),
                    lastMenuItemClicked > 0 ? React.createElement(Text, { style: textColor }, lastMenuItemClicked) : React.createElement(Text, { style: textColor }, "none")),
                React.createElement(View, { style: __assign(__assign({}, rowStyle), { paddingHorizontal: 5 }) },
                    React.createElement(View, { style: columnStyle },
                        React.createElement(MenuButton, { content: "Standard MenuButton", menuItems: menuItems, onItemClick: onItemClick, contextualMenu: contextualMenuProps }),
                        React.createElement(Text, null, "MenuButton with icon"),
                        React.createElement(MenuButton, { icon: iconToShow, content: "MenuButton", menuItems: menuItems, onItemClick: onItemClick, contextualMenu: contextualMenuProps }),
                        React.createElement(Text, null, "MenuButton with only icon"),
                        React.createElement(MenuButton, { icon: iconToShow, menuItems: menuItems, onItemClick: onItemClick, contextualMenu: contextualMenuProps }),
                        React.createElement(Text, null, "Disabled MenuButton"),
                        React.createElement(MenuButton, { disabled: true, content: "Disabled MenuButton", menuItems: menuItems })),
                    React.createElement(Separator, { vertical: true }),
                    React.createElement(View, { style: columnStyle },
                        React.createElement(MenuButton, { appearance: "primary", content: "Primary MenuButton", menuItems: menuItems, onItemClick: onItemClick, contextualMenu: contextualMenuProps }),
                        React.createElement(Text, null, "Primary MenuButton with icon"),
                        React.createElement(MenuButton, { appearance: "primary", icon: iconToShow, content: "Primary MenuButton", menuItems: menuItems, onItemClick: onItemClick, contextualMenu: contextualMenuProps }),
                        React.createElement(Text, null, "Primary MenuButton with only icon"),
                        React.createElement(MenuButton, { appearance: "primary", icon: iconToShow, menuItems: menuItems, onItemClick: onItemClick, contextualMenu: contextualMenuProps }),
                        React.createElement(Text, null, "Primary Disabled MenuButton"),
                        React.createElement(MenuButton, { appearance: "primary", disabled: true, content: "Disabled Primary MenuButton", menuItems: menuItems })))))));
};
//# sourceMappingURL=StandardMenuButtonTest.js.map