import { QuickViewCard } from "../UI/surfaces/cards/QuickViewCard.mjs";
import { c } from "react-compiler-runtime";
import React, { useState } from "react";
//#region src/hooks/useItemSubCard.jsx
/**
* `useItemSubCard` hook
*/
const useItemSubCard = (subCardsList) => {
	const $ = c(11);
	const [subCardType, setSubCardType] = useState("");
	let t0;
	if ($[0] !== subCardsList) {
		t0 = (subCardTypeStr) => {
			const subCardInfo = subCardsList?.[subCardTypeStr];
			if (!subCardInfo) return {
				defaultColor: null,
				textColor: null,
				backgroundColor: null,
				icon: _temp
			};
			return {
				defaultColor: subCardInfo.defaultColor,
				textColor: subCardInfo.textColor,
				backgroundColor: subCardInfo.backgroundColor,
				icon: subCardInfo.icon
			};
		};
		$[0] = subCardsList;
		$[1] = t0;
	} else t0 = $[1];
	const getSubCardInfo = t0;
	let t1;
	if ($[2] !== subCardType || $[3] !== subCardsList) {
		t1 = (t2, child) => {
			const { cardInfo, ...rest } = t2;
			return /* @__PURE__ */ React.createElement(QuickViewCard, null, subCardsList?.[subCardType]?.component({
				cardInfo,
				...rest
			}));
		};
		$[2] = subCardType;
		$[3] = subCardsList;
		$[4] = t1;
	} else t1 = $[4];
	const SubCard = t1;
	let t2;
	let t3;
	if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
		t2 = () => setSubCardType(false);
		t3 = (cardType) => setSubCardType(cardType);
		$[5] = t2;
		$[6] = t3;
	} else {
		t2 = $[5];
		t3 = $[6];
	}
	let t4;
	if ($[7] !== SubCard || $[8] !== getSubCardInfo || $[9] !== subCardType) {
		t4 = {
			SubCard,
			closeSubCard: t2,
			setSubCardType: t3,
			subCardType,
			getSubCardInfo
		};
		$[7] = SubCard;
		$[8] = getSubCardInfo;
		$[9] = subCardType;
		$[10] = t4;
	} else t4 = $[10];
	return t4;
};
function _temp() {
	return null;
}
//#endregion
export { useItemSubCard };

//# sourceMappingURL=useItemSubCard.mjs.map