/**
 * Copyright IBM Corp. 2020, 2026
 *
 * This source code is licensed under the Apache-2.0 license found in the
 * LICENSE file in the root directory of this source tree.
 */

const require_runtime = require('../../_virtual/_rolldown/runtime.js');
const require_settings = require('../../settings.js');
let react = require("react");
react = require_runtime.__toESM(react);
let prop_types = require("prop-types");
prop_types = require_runtime.__toESM(prop_types);
let _carbon_react = require("@carbon/react");
let _carbon_react_icons = require("@carbon/react/icons");

//#region src/components/AddSelect/AddSelectMetaPanel.jsx
const blockClass = `${require_settings.pkg.prefix}--add-select__meta-panel`;
const componentName = "AddSelectMetaPanel";
let AddSelectMetaPanel = ({ closeIconDescription, meta, setDisplayMetaPanel, title }) => {
	const onCloseHandler = () => {
		setDisplayMetaPanel({});
	};
	return /* @__PURE__ */ react.default.createElement("div", { className: blockClass }, /* @__PURE__ */ react.default.createElement("div", { className: `${blockClass}-header` }, /* @__PURE__ */ react.default.createElement("p", { className: `${blockClass}-title` }, title), /* @__PURE__ */ react.default.createElement(_carbon_react.Button, {
		renderIcon: (props) => /* @__PURE__ */ react.default.createElement(_carbon_react_icons.Close, {
			size: 16,
			...props
		}),
		className: `${blockClass}-close`,
		iconDescription: closeIconDescription,
		tooltipPosition: "left",
		tooltipAlignment: "center",
		hasIconOnly: true,
		onClick: onCloseHandler,
		kind: "ghost",
		size: "sm"
	})), (0, react.isValidElement)(meta) ? meta : meta.map((entry) => /* @__PURE__ */ react.default.createElement("div", {
		key: entry?.id,
		className: `${blockClass}-entry`
	}, /* @__PURE__ */ react.default.createElement("p", { className: `${blockClass}-entry-title` }, entry?.title), /* @__PURE__ */ react.default.createElement("p", { className: `${blockClass}-entry-body` }, entry?.value))));
};
AddSelectMetaPanel.propTypes = {
	closeIconDescription: prop_types.default.string.isRequired,
	meta: prop_types.default.oneOfType([prop_types.default.arrayOf(prop_types.default.shape({
		id: prop_types.default.string,
		title: prop_types.default.string,
		value: prop_types.default.string
	})), prop_types.default.node]).isRequired,
	setDisplayMetaPanel: prop_types.default.func.isRequired,
	title: prop_types.default.string.isRequired
};
AddSelectMetaPanel.displayName = componentName;

//#endregion
exports.AddSelectMetaPanel = AddSelectMetaPanel;