/*---------------------------------------------------------------------------------------------
 * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
 * See LICENSE.md in the project root for license terms and full copyright notice.
 *--------------------------------------------------------------------------------------------*/
/** @packageDocumentation
 * @module Toolbar
 */
import * as React from "react";
import { ToolGroupOverflowContext } from "./OverflowButton";
import { Item } from "./Item";
import { GroupMenuItem } from "./GroupItem";
/** @internal */
export const ActionItem = React.forwardRef(function ActionItem({ item }, ref) {
    const overflowContext = React.useContext(ToolGroupOverflowContext);
    if (overflowContext) {
        return React.createElement(GroupMenuItem, { item: item, onClose: overflowContext.onClose });
    }
    return (React.createElement(Item, { ref: ref, item: item, onClick: () => {
            item.execute();
        } }));
});
//# sourceMappingURL=ActionItem.js.map