/**
 * 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/Datagrid/Datagrid/addons/CustomizeColumns/ButtonWrapper.tsx
/**
* Copyright IBM Corp. 2022, 2024
*
* 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 blockClass = `${require_settings.pkg.prefix}--datagrid`;
const ButtonWrapper = react.forwardRef(({ onClick, setIsTearsheetOpen, isTearsheetOpen, iconTooltipLabel = "Customize columns", ...rest }, ref) => /* @__PURE__ */ react.createElement(_carbon_react.Button, {
	...rest,
	renderIcon: (props) => /* @__PURE__ */ react.createElement(_carbon_react_icons.Column, {
		size: 16,
		...props
	}),
	iconDescription: iconTooltipLabel,
	tooltipPosition: "bottom",
	kind: "ghost",
	hasIconOnly: true,
	"test-id": `${blockClass}__customize-columns-trigger`,
	ref,
	onClick: () => {
		setIsTearsheetOpen(!isTearsheetOpen);
		if (typeof onClick === "function") onClick();
	}
}));
ButtonWrapper.propTypes = {
	iconTooltipLabel: prop_types.default.string,
	isTearsheetOpen: prop_types.default.bool.isRequired,
	onClick: prop_types.default.func.isRequired,
	setIsTearsheetOpen: prop_types.default.func.isRequired
};
//#endregion
exports.default = ButtonWrapper;
