const require_runtime = require("../../_virtual/_rolldown/runtime.js");
const require_objectSpread2 = require("../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js");
const require_index = require("../pisellLoading/index.js");
let react = require("react");
react = require_runtime.__toESM(react);
let classnames = require("classnames");
classnames = require_runtime.__toESM(classnames);
require("./index.less");
//#region src/components/pisellViewGrid/index.tsx
const PisellViewGrid = ({ columns = 3, horizontalGap = 10, verticalGap = 10, singleRow = false, dataSource = [], renderItem, loading = false, children, className, style }) => {
	const classes = (0, classnames.default)("pisell-view-grid", { "pisell-view-grid-single-row": singleRow }, className);
	return /* @__PURE__ */ react.default.createElement(require_index.default, {
		loading,
		fullscreen: false,
		style: { width: "100%" }
	}, /* @__PURE__ */ react.default.createElement("div", {
		className: classes,
		style: require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, style), {}, {
			width: "100%",
			overflow: "hidden"
		})
	}, /* @__PURE__ */ react.default.createElement("div", {
		className: "pisell-view-grid-content",
		style: !singleRow ? {
			gap: `${verticalGap}px ${horizontalGap}px`,
			gridTemplateColumns: `repeat(${columns}, 1fr)`,
			width: "100%"
		} : {
			display: "flex",
			flexWrap: "nowrap",
			overflowX: "auto",
			width: "100%"
		}
	}, dataSource.map((item, index) => /* @__PURE__ */ react.default.createElement("div", {
		key: index,
		className: "pisell-view-grid-item",
		style: {
			minWidth: 0,
			flex: `0 0 calc(100% / ${columns})`
		}
	}, renderItem === null || renderItem === void 0 ? void 0 : renderItem(item, index))))));
};
//#endregion
exports.default = PisellViewGrid;
