// (C) 2021-2026 GoodData Corporation
import { compact } from "lodash-es";
import { eagerRemoveSectionItemByWidgetRef } from "../../../../model/commands/layout.js";
import { RichTextConfiguration } from "../../richText/configuration/RichTextConfiguration.js";
/**
 * @internal
 */
export function getDefaultRichTextEditMode(widget, { intl, dispatch, enableRichTextWidgetFilterConfiguration = false }) {
    return compact([
        enableRichTextWidgetFilterConfiguration && {
            type: "submenu",
            itemId: "ConfigurationPanelSubmenu",
            tooltip: "",
            itemName: intl.formatMessage({ id: "configurationPanel.title" }),
            icon: "gd-icon-settings",
            disabled: false,
            className: "s-configuration-panel-submenu",
            SubmenuComponent: RichTextConfiguration,
        },
        enableRichTextWidgetFilterConfiguration && {
            type: "separator",
            itemId: "ConfigurationPanelRemoveSeparator",
        },
        {
            type: "button",
            itemId: "InteractionPanelRemove",
            tooltip: "",
            itemName: intl.formatMessage({ id: "configurationPanel.remove.form.dashboard" }),
            icon: "gd-icon-trash",
            disabled: false,
            className: "s-delete-insight-item",
            onClick: () => dispatch(eagerRemoveSectionItemByWidgetRef(widget.ref)),
        },
    ]);
}
//# sourceMappingURL=getDefaultRichTextEditMenuItems.js.map