import { jsx as _jsx } from "react/jsx-runtime";
import { useDashboardDispatch, useDashboardSelector } from "../../../model/react/DashboardStoreProvider.js";
import { uiActions } from "../../../model/store/ui/index.js";
import { selectSectionModification, selectWidgetsOverlayState } from "../../../model/store/ui/uiSelectors.js";
import { getRefsForSection } from "../refs.js";
import { DashboardItemOverlay } from "./DashboardItemOverlay.js";
export function DashboardLayoutSectionOverlayController({ section, }) {
    const dispatch = useDashboardDispatch();
    const refs = getRefsForSection(section);
    const overlayShow = useDashboardSelector(selectWidgetsOverlayState(refs));
    const sectionModifications = useDashboardSelector(selectSectionModification(refs));
    return (_jsx(DashboardItemOverlay, { type: "column", onHide: () => dispatch(uiActions.toggleWidgetsOverlay({
            refs: section.items().map((item) => item.ref()),
            visible: false,
        })), render: overlayShow, modifications: sectionModifications }));
}
//# sourceMappingURL=DashboardItemOverlayController.js.map