"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.TabsOverflowMenuExample = void 0;
var tslib_1 = require("tslib");
var React = require("react");
var react_1 = require("@fluentui/react");
var react_hooks_1 = require("@fluentui/react-hooks");
var react_tabs_1 = require("@fluentui/react-tabs");
var TabsOverflowMenuExample = function () {
    var _a = react_hooks_1.useBoolean(true), overflow = _a[0], toggleOverflow = _a[1].toggle;
    var _b = react_hooks_1.useBoolean(false), tabs = _b[0], toggleTabs = _b[1].toggle;
    var _c = react_hooks_1.useBoolean(false), rtl = _c[0], toggleRtl = _c[1].toggle;
    return (React.createElement(React.Fragment, null,
        React.createElement(react_1.Fabric // eslint-disable-line deprecation/deprecation
        , { dir: rtl ? 'rtl' : 'ltr' },
            React.createElement(react_tabs_1.Tabs, { "aria-label": "Tabs Overflow Menu Example", tabFormat: tabs ? 'tabs' : 'links', overflowBehavior: overflow ? 'menu' : 'none' },
                React.createElement(react_tabs_1.TabItem, { headerText: "My Files" },
                    React.createElement(react_1.Label, null, "Tab #1")),
                React.createElement(react_tabs_1.TabItem, { itemCount: 23, itemIcon: "Recent" },
                    React.createElement(react_1.Label, null, "Tab #2")),
                React.createElement(react_tabs_1.TabItem, { headerText: "Placeholder", itemIcon: "Globe" },
                    React.createElement(react_1.Label, null, "Tab #3")),
                React.createElement(react_tabs_1.TabItem, { headerText: "Shared with me", itemIcon: "Ringer", itemCount: 1 },
                    React.createElement(react_1.Label, null, "Tab #4")),
                React.createElement(react_tabs_1.TabItem, { headerText: "Custom Renderer", itemIcon: "Airplane", onRenderTab: _customRenderer },
                    React.createElement(react_1.Label, null, "Tab #5")),
                React.createElement(react_tabs_1.TabItem, { headerText: "This tab has a relatively long title" },
                    React.createElement(react_1.Label, null, "Tab #6")),
                React.createElement(react_tabs_1.TabItem, { headerText: "Short" },
                    React.createElement(react_1.Label, null, "Tab #7")),
                React.createElement(react_tabs_1.TabItem, { headerText: "The Last Tab" },
                    React.createElement(react_1.Label, null, "Tab #8")))),
        React.createElement("div", { style: { background: '#EEE', marginTop: 10 } },
            React.createElement(react_1.Toggle, { label: "overflow", offText: "none", onText: "menu", checked: overflow, onChange: toggleOverflow }),
            React.createElement(react_1.Toggle, { label: "tabFormat", offText: "links", onText: "tabs", checked: tabs, onChange: toggleTabs }),
            React.createElement(react_1.Toggle, { label: "direction", offText: "ltr", onText: "rtl", checked: rtl, onChange: toggleRtl }))));
};
exports.TabsOverflowMenuExample = TabsOverflowMenuExample;
function _customRenderer(tab, defaultRenderer) {
    if (!tab || !defaultRenderer) {
        return null;
    }
    return (React.createElement("span", { style: { flex: '0 1 100%' } },
        defaultRenderer(tslib_1.__assign(tslib_1.__assign({}, tab), { itemIcon: undefined })),
        React.createElement(react_1.Icon, { iconName: tab.itemIcon, style: { color: 'red' } })));
}
//# sourceMappingURL=Tabs.OverflowMenu.Example.js.map