import { n as AnalyticsId } from "../../constants2.js";
import { i as PanelOldVariant, t as PanelOld_default } from "../../PanelOld.js";
import React from "react";
import classNames from "classnames";
import { jsx } from "react/jsx-runtime";
import styles from "./styles.module.scss";
var isPanelComponent = (element) => React.isValidElement(element) && element.type === PanelOld_default;
var PanelListOld_default = React.forwardRef(function BadgeForwardedRef(props, ref) {
	const { testId, children, variant = PanelOldVariant.fill } = props;
	const renderPanel = (panel, firstChild) => React.cloneElement(panel, {
		variant,
		noTopBorder: variant === PanelOldVariant.line && !firstChild,
		className: classNames(panel.props.className, variant !== PanelOldVariant.line && styles["panel-list__panel"])
	});
	return /* @__PURE__ */ jsx("div", {
		ref,
		"data-testid": testId,
		"data-analyticsid": AnalyticsId.PanelList,
		children: React.Children.map(children, (child, index) => isPanelComponent(child) ? renderPanel(child, index === 0) : child)
	});
});
export { PanelListOld_default as default };

//# sourceMappingURL=index.js.map