import React from "react";
import { ArrowDownOutlined, ArrowUpOutlined } from "@ant-design/icons";
import classNames from "classnames";
import "./index.less";
//#region src/components/pisellGridPro/components/DataCard/components/StatCard/index.tsx
/**
* StatCard 统计卡片组件
* @description 用于展示单个统计数据，包含标题、数值和对比信息
* @author Pisell Team
*/
const StatCard = (props) => {
	const { title, value, compareValue, trend, comparePrefix = "v.s. pre", showCompare = true, style, className, onClick } = props;
	/** 卡片类名 */
	const cardClassName = classNames("stat-card", { "stat-card-clickable": !!onClick }, className);
	/** 对比信息类名 */
	const compareClassName = classNames("stat-card-compare", {
		"trend-up": trend === "up",
		"trend-down": trend === "down"
	});
	/**
	* 渲染趋势图标
	*/
	const renderTrendIcon = () => {
		if (!trend) return null;
		if (trend === "up") return /* @__PURE__ */ React.createElement(ArrowUpOutlined, { className: "trend-icon" });
		if (trend === "down") return /* @__PURE__ */ React.createElement(ArrowDownOutlined, { className: "trend-icon" });
		return null;
	};
	return /* @__PURE__ */ React.createElement("div", {
		className: cardClassName,
		style,
		onClick
	}, title && /* @__PURE__ */ React.createElement("div", { className: "stat-card-title" }, title), /* @__PURE__ */ React.createElement("div", { className: "stat-card-content" }, /* @__PURE__ */ React.createElement("div", { className: "stat-card-value" }, value), showCompare && compareValue && /* @__PURE__ */ React.createElement("div", { className: compareClassName }, /* @__PURE__ */ React.createElement("span", { className: "compare-prefix" }, comparePrefix), /* @__PURE__ */ React.createElement("span", { className: "compare-value" }, compareValue), renderTrendIcon())));
};
//#endregion
export { StatCard as default };
