const require_runtime = require("../../../../../_virtual/_rolldown/runtime.js");
const require_index = require("../../../../iconfont/index.js");
const require_utils = require("../../../utils.js");
const require_index$1 = require("../../index.js");
let react = require("react");
react = require_runtime.__toESM(react);
let antd = require("antd");
let dayjs = require("dayjs");
dayjs = require_runtime.__toESM(dayjs);
require("dayjs/locale/zh-cn");
require("dayjs/locale/ja");
require("dayjs/locale/pt");
require("dayjs/locale/en");
require("dayjs/locale/zh-tw");
require("./index.less");
//#region src/components/productCard/cartSkuCard/components/timeRange/index.tsx
const localeTypes = {
	"en-US": "en",
	"zh-CN": "zh-cn",
	"zh-HK": "zh-tw",
	"ja": "ja",
	"pt": "pt"
};
const TimeRange = (props) => {
	const { dataSource = {} } = props;
	const { start_date, end_date, locale = "en-US" } = dataSource;
	if (!(0, dayjs.default)(start_date).isValid() || !(0, dayjs.default)(end_date).isValid()) return null;
	(0, react.useEffect)(() => {
		dayjs.default.locale(localeTypes[locale]);
	}, [locale]);
	const isEn = (0, react.useMemo)(() => {
		return locale === "en-US" || locale === "en";
	}, [locale]);
	(0, react.useMemo)(() => {
		return isEn ? "HH:mm DD/MM/YYYY" : "YYYY-MM-DD HH:mm";
	}, [isEn]);
	return /* @__PURE__ */ react.default.createElement(react.default.Fragment, null, /* @__PURE__ */ react.default.createElement(antd.Divider, { style: { margin: "0" } }), /* @__PURE__ */ react.default.createElement("div", { className: `${require_index$1.PREFIX}__time-range` }, /* @__PURE__ */ react.default.createElement(require_index.default, {
		className: "time-icon",
		type: "pisell2-clock"
	}), require_utils.getServiceTime(dataSource, start_date)));
};
//#endregion
exports.default = TimeRange;
