import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
import { serializeLayoutItemPath } from "../../../_staging/layout/coordinates.js";
import { useScreenSize } from "../../dashboard/components/DashboardScreenSizeContext.js";
import { DashboardLayoutItem } from "./DashboardLayoutItem.js";
const defaultItemKeyGetter = ({ item }) => serializeLayoutItemPath(item.index());
export function DashboardLayoutGridRow({ section, itemKeyGetter = defaultItemKeyGetter, gridRowRenderer, itemRenderer, widgetRenderer, items, renderMode, rowIndex, }) {
    const screen = useScreenSize();
    const rowItems = items.map((item) => (_jsx(DashboardLayoutItem, { renderMode: renderMode, item: item, itemRenderer: itemRenderer, widgetRenderer: widgetRenderer, rowIndex: rowIndex }, itemKeyGetter({ item, screen }))));
    return (_jsx(_Fragment, { children: gridRowRenderer
            ? gridRowRenderer({
                children: rowItems,
                section,
                items,
                renderMode,
            })
            : rowItems }));
}
