import { __assign } from "tslib";
import * as React from 'react';
import { Fabric, Icon, Label, Pivot, PivotItem, Toggle } from '@fluentui/react';
import { useBoolean } from '@fluentui/react-hooks';
export var PivotOverflowMenuExample = function () {
    var _a = useBoolean(true), overflow = _a[0], toggleOverflow = _a[1].toggle;
    var _b = useBoolean(false), tabs = _b[0], toggleTabs = _b[1].toggle;
    var _c = useBoolean(false), rtl = _c[0], toggleRtl = _c[1].toggle;
    return (React.createElement(React.Fragment, null,
        React.createElement("div", { style: { background: '#EEE' } },
            React.createElement(Toggle, { label: "overflow", offText: "none", onText: "menu", checked: overflow, onChange: toggleOverflow }),
            React.createElement(Toggle, { label: "linkFormat", offText: "links", onText: "tabs", checked: tabs, onChange: toggleTabs }),
            React.createElement(Toggle, { label: "direction", offText: "ltr", onText: "rtl", checked: rtl, onChange: toggleRtl })),
        React.createElement(Fabric, { dir: rtl ? 'rtl' : 'ltr' },
            React.createElement(Pivot, { "aria-label": "Pivot Overflow Menu Example", linkFormat: tabs ? 'tabs' : 'links', overflowBehavior: overflow ? 'menu' : 'none' },
                React.createElement(PivotItem, { headerText: "My Files" },
                    React.createElement(Label, null, "Pivot #1")),
                React.createElement(PivotItem, { itemCount: 23, itemIcon: "Recent" },
                    React.createElement(Label, null, "Pivot #2")),
                React.createElement(PivotItem, { headerText: "Placeholder", itemIcon: "Globe" },
                    React.createElement(Label, null, "Pivot #3")),
                React.createElement(PivotItem, { headerText: "Shared with me", itemIcon: "Ringer", itemCount: 1 },
                    React.createElement(Label, null, "Pivot #4")),
                React.createElement(PivotItem, { headerText: "Custom Renderer", itemIcon: "Airplane", onRenderItemLink: _customRenderer },
                    React.createElement(Label, null, "Pivot #5")),
                React.createElement(PivotItem, { headerText: "This tab has a relatively long title" },
                    React.createElement(Label, null, "Pivot #6")),
                React.createElement(PivotItem, { headerText: "Short" },
                    React.createElement(Label, null, "Pivot #7")),
                React.createElement(PivotItem, { headerText: "The Last Tab" },
                    React.createElement(Label, null, "Pivot #8"))))));
};
function _customRenderer(link, defaultRenderer) {
    if (!link || !defaultRenderer) {
        return null;
    }
    return (React.createElement("span", { style: { flex: '0 1 100%' } },
        defaultRenderer(__assign(__assign({}, link), { itemIcon: undefined })),
        React.createElement(Icon, { iconName: link.itemIcon, style: { color: 'red' } })));
}
//# sourceMappingURL=Pivot.OverflowMenu.Example.js.map