/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-e694c50 | Cube Dev Team */
//#region src/utils/react/useQaProps.ts
/**
* Processes QA props.
* If `qa` or `qaVal` props are present, they are not modified and have higher priority.
* Otherwise, maps `data-qa` to `qa` and `data-qa-val` to `qaVal`.
* Data attributes are always removed.
* Modifies the original props object without copying it.
* Accepts only non-falsy values, otherwise deletes both props.
*
* @param props - The object to process
* @returns The modified object
*/
function useQaProps(props) {
	const processQaAttribute = (propName, dataAttrName) => {
		if (props[propName] !== void 0 || props[dataAttrName] !== void 0) {
			const propValue = props[propName];
			const dataAttrValue = props[dataAttrName];
			if (!propValue) if (dataAttrValue) props[propName] = dataAttrValue;
			else delete props[propName];
			delete props[dataAttrName];
		}
	};
	processQaAttribute("qa", "data-qa");
	processQaAttribute("qaVal", "data-qa-val");
	return props;
}

//#endregion
export { useQaProps };
//# sourceMappingURL=useQaProps.js.map