const require_runtime = require("../../../_virtual/_rolldown/runtime.js");
const require_formatDate = require("../../pisellDateTimeDisplay/utils/formatDate.js");
const require_relativeDay = require("../../pisellDateTimeDisplay/utils/relativeDay.js");
let react = require("react");
react = require_runtime.__toESM(react);
let dayjs = require("dayjs");
dayjs = require_runtime.__toESM(dayjs);
//#region src/components/pisellTimeRangeDisplay/components/DateBlock.tsx
/**
* 日期展示块（复用 PisellDateTimeDisplay 的 formatDate 与相对日逻辑）
*/
const DateBlock = ({ date, format, referenceDate = (0, dayjs.default)(), style, className }) => {
	var _labels$relativeDay;
	const labels = format === null || format === void 0 ? void 0 : format.relativeDayLabels;
	const relativeDay = (format === null || format === void 0 ? void 0 : format.showRelativeDay) ? require_relativeDay.getRelativeDay(date, referenceDate) : null;
	const formattedDate = relativeDay ? (_labels$relativeDay = labels === null || labels === void 0 ? void 0 : labels[relativeDay]) !== null && _labels$relativeDay !== void 0 ? _labels$relativeDay : require_relativeDay.getRelativeDayLabel(relativeDay, date.locale()) : require_formatDate.formatDate(date, format);
	if (!formattedDate) return null;
	const inlineStyle = {
		fontSize: style === null || style === void 0 ? void 0 : style.fontSize,
		fontWeight: style === null || style === void 0 ? void 0 : style.fontWeight,
		color: style === null || style === void 0 ? void 0 : style.color,
		lineHeight: style === null || style === void 0 ? void 0 : style.lineHeight
	};
	return /* @__PURE__ */ react.default.createElement("span", {
		className: `pisell-time-range-display-date ${className || ""}`.trim(),
		style: inlineStyle
	}, formattedDate);
};
//#endregion
exports.default = DateBlock;
