import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
// (C) 2007-2026 GoodData Corporation
import cx from "classnames";
import { isCustomWidgetBase } from "../../../model/types/layoutTypes.js";
import { renderModeAware } from "../../componentDefinition/renderModeAware.js";
import { RowEndHotspot } from "../dragAndDrop/draggableWidget/RowEndHotspot.js";
import { useIsDraggingCurrentItem } from "../dragAndDrop/draggableWidget/useIsDraggingCurrentItem.js";
import { DashboardLayoutItemViewRenderer } from "./DashboardLayoutItemViewRenderer.js";
function DashboardLayoutItemEditRenderer(props) {
    const { item, children, rowIndex } = props;
    const isDraggingCurrentItem = useIsDraggingCurrentItem(item.index());
    const isCustomWidget = isCustomWidgetBase(item.widget());
    return (_jsxs(_Fragment, { children: [
            _jsx(DashboardLayoutItemViewRenderer, { ...props, className: cx({
                    "current-dragging-item": isDraggingCurrentItem,
                }), children: children }), isCustomWidget ? null : _jsx(RowEndHotspot, { item: item, rowIndex: rowIndex })] }));
}
/**
 * @internal
 */
export const DashboardLayoutItemRenderer = renderModeAware({
    view: DashboardLayoutItemViewRenderer,
    edit: DashboardLayoutItemEditRenderer,
});
//# sourceMappingURL=DashboardLayoutItemRenderer.js.map