/**
 * 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 React, { forwardRef, isValidElement } from "react";
import PropTypes from "prop-types";

//#region src/components/Datagrid/Datagrid/addons/AiLabel/DatagridAiLabel.tsx
/**
* 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 DatagridAILabel = forwardRef(({ aiLabel }, ref) => {
	if (aiLabel && isValidElement(aiLabel)) return React.cloneElement(aiLabel, {
		size: "mini",
		ref
	});
	return null;
});
DatagridAILabel.propTypes = { aiLabel: PropTypes.node };

//#endregion
export { DatagridAILabel };