import { _objectSpread2 } from "../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js";
import { _objectWithoutProperties } from "../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectWithoutProperties.js";
import usePisellConfig from "../pisell-config-provider/hooks/usePisellConfig.js";
import React, { useMemo } from "react";
import { isNumber } from "@pisell/utils";
import classNames from "classnames";
import "./index.less";
//#region src/components/pisellRow/index.tsx
const _excluded = [
	"platform",
	"gap",
	"padding",
	"style",
	"leftContent",
	"rightContent",
	"centerContent",
	"centerContentFill"
];
/**
* @title: Pisell Row
* @description:  左中右布局组件
* @param {PisellRowProps} props
* @return {*}
* @Author: zhiwei.Wang
* @Date: 2024-08-16 10:38
*/
const PisellRow = (props) => {
	usePisellConfig();
	const { platform = "h5", gap, padding, style, leftContent, rightContent, centerContent, centerContentFill } = props, rest = _objectWithoutProperties(props, _excluded);
	const _style = useMemo(() => {
		return _objectSpread2({
			padding: isNumber(padding) ? padding + "px" : padding,
			gap: isNumber(gap) ? gap + "px" : gap
		}, style);
	}, [
		style,
		padding,
		gap
	]);
	return /* @__PURE__ */ React.createElement("div", _objectSpread2(_objectSpread2({}, rest), {}, {
		className: classNames("pisell-row", rest.className),
		style: _style
	}), leftContent && /* @__PURE__ */ React.createElement("div", { className: "pisell-row-left" }, leftContent), /* @__PURE__ */ React.createElement("div", {
		className: "pisell-row-center",
		style: { flex: centerContentFill ? 1 : "unset" }
	}, centerContent), rightContent && /* @__PURE__ */ React.createElement("div", { className: "pisell-row-right" }, rightContent));
};
//#endregion
export { PisellRow as default };
