/**
 * 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/Decorator/Decorator.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 = "Decorator";
/**
* The Decorator groups a key/value pair as a single element. This component is not interactive.
*/
let Decorator = React.forwardRef((props, ref) => {
	const validProps = prepareProps(props, [
		"disabled",
		"kind",
		"onClick",
		"onClickLabel",
		"onClickValue",
		"onContextMenu",
		"onContextMenuLabel",
		"onContextMenuValue"
	]);
	return /* @__PURE__ */ React.createElement(DecoratorBase, {
		ref,
		...validProps,
		kind: "default",
		...getDevtoolsProps(componentName)
	});
});
Decorator = pkg.checkComponentEnabled(Decorator, componentName);
Decorator.displayName = componentName;
Decorator.propTypes = {
	className: PropTypes.string,
	hideIcon: PropTypes.bool,
	label: PropTypes.string,
	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 { Decorator };