/**
 * 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 { getDevtoolsProps } from "../../global/js/utils/devtools.js";
import { prepareProps } from "../../global/js/utils/props-helper.js";
import { DecoratorBase } from "../DecoratorBase/DecoratorBase.js";
import React from "react";
import PropTypes from "prop-types";

//#region src/components/DecoratorSingleButton/DecoratorSingleButton.jsx
/**
* Copyright IBM Corp. 2024, 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 componentName = "DecoratorSingleButton";
/**
* The DecoratorSingleButton groups a key/value pair to behave like a button.
* @deprecated This component is deprecated
*/
let DecoratorSingleButton = React.forwardRef((props, ref) => {
	const validProps = prepareProps(props, [
		"href",
		"kind",
		"onClickLabel",
		"onClickValue",
		"onContextMenuLabel",
		"onContextMenuValue"
	]);
	return /* @__PURE__ */ React.createElement(DecoratorBase, {
		ref,
		...validProps,
		kind: "single-button",
		...getDevtoolsProps(componentName)
	});
});
DecoratorSingleButton.deprecated = {
	level: "warn",
	details: `This component is deprecated`
};
DecoratorSingleButton = pkg.checkComponentEnabled(DecoratorSingleButton, componentName);
DecoratorSingleButton.displayName = componentName;
DecoratorSingleButton.propTypes = {
	className: PropTypes.string,
	disabled: PropTypes.bool,
	hideIcon: PropTypes.bool,
	label: PropTypes.string,
	onClick: PropTypes.func,
	onContextMenu: PropTypes.func,
	score: PropTypes.number,
	scoreThresholds: PropTypes.arrayOf(PropTypes.number),
	setLabelTitle: PropTypes.func,
	small: PropTypes.bool,
	theme: PropTypes.oneOf(["light", "dark"]),
	truncateValue: PropTypes.oneOfType([PropTypes.oneOf(["end", "start"]), PropTypes.shape({
		maxLength: PropTypes.number,
		front: PropTypes.number,
		back: PropTypes.number
	})]),
	value: PropTypes.string.isRequired,
	valueTitle: PropTypes.string
};

//#endregion
export { DecoratorSingleButton };