/**
 * 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.
 */

import { pkg } from "../../../../../settings.js";
import * as React$1 from "react";
import PropTypes from "prop-types";
import { Button } from "@carbon/react";
import { Column as Column$1 } from "@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 = `${pkg.prefix}--datagrid`;
const ButtonWrapper = React$1.forwardRef(({ onClick, setIsTearsheetOpen, isTearsheetOpen, iconTooltipLabel = "Customize columns", ...rest }, ref) => /* @__PURE__ */ React$1.createElement(Button, {
	...rest,
	renderIcon: (props) => /* @__PURE__ */ React$1.createElement(Column$1, {
		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: PropTypes.string,
	isTearsheetOpen: PropTypes.bool.isRequired,
	onClick: PropTypes.func.isRequired,
	setIsTearsheetOpen: PropTypes.func.isRequired
};

//#endregion
export { ButtonWrapper as default };