import useEngineContext from "../../../../../../hooks/useEngineContext.js";
import { PREFIX } from "../../status.js";
import React, { useMemo } from "react";
import "./index.less";
//#region src/plus/productSelect/ProductCard/SkuCard/components/Title/index.tsx
const Title = ({ props }) => {
	var _engineContext$appHel;
	const { dataSource, skuTextConfig } = props;
	const { translation } = (_engineContext$appHel = useEngineContext().appHelper) === null || _engineContext$appHel === void 0 ? void 0 : _engineContext$appHel.utils;
	const { isOpen, value, fontSize, fontWeight, color, ellipsisCount } = (skuTextConfig === null || skuTextConfig === void 0 ? void 0 : skuTextConfig.skuNameConfig) || {};
	if (!isOpen) return null;
	const finalStyle = useMemo(() => {
		return {
			fontSize,
			fontWeight,
			color,
			lineClamp: ellipsisCount
		};
	}, [
		fontSize,
		fontWeight,
		color,
		ellipsisCount
	]);
	return /* @__PURE__ */ React.createElement("div", {
		className: `${PREFIX}__card-title`,
		style: finalStyle
	}, translation(value || (dataSource === null || dataSource === void 0 ? void 0 : dataSource.title)));
};
//#endregion
export { Title as default };
