import Title from "../components/Title/index.js";
import SubTitle from "../components/SubTitle/index.js";
import Price from "../components/Price/index.js";
import Tags from "../components/Tags/index.js";
import MemberPrice from "../components/MemberPrice/index.js";
import Countdown from "../components/Countdown/index.js";
import Stock from "../components/Stock/index.js";
import Capacity from "../components/Capacity/index.js";
import Duration from "../components/Duration/index.js";
import Time from "../components/Time/index.js";
import Resource from "../components/Resource/index.js";
import Promotions from "../components/Promotions/index.js";
import React from "react";
//#region src/plus/productSelect/ProductCard/SkuCard/hooks/useDynamicComponents.ts
const componentMap = {
	title: Title,
	subtitle: SubTitle,
	price: Price,
	memberPrice: MemberPrice,
	tags: Tags,
	countdown: Countdown,
	stock: Stock,
	capacity: Capacity,
	duration: Duration,
	time: Time,
	resource: Resource,
	promotions: Promotions
};
const useDynamicComponents = () => {
	const renderComponent = (key, props) => {
		const Component = componentMap[key];
		if (!Component) return null;
		return React.createElement(Component, {
			key,
			props
		});
	};
	const renderComponents = (props) => {
		return ((props === null || props === void 0 ? void 0 : props.sortKeys) || []).map((key) => renderComponent(key, props));
	};
	return {
		renderComponent,
		renderComponents,
		componentMap
	};
};
//#endregion
export { useDynamicComponents };
