import { ErrorTypeTheme, errorTypes, prefix } from "../types.js";
import React from "react";
import classNames from "classnames";
import "./index.less";
//#region src/components/hardwareErrorTip/errorTipStatistics/index.tsx
const renderErrorItem = (errorType, count) => {
	const IconComponent = errorType.icon;
	const theme = ErrorTypeTheme[errorType.type];
	return /* @__PURE__ */ React.createElement("div", {
		key: errorType.type,
		className: classNames(`${prefix}-error-tip-statistics-item ${errorType.type}`),
		style: {
			backgroundColor: theme.backgroundColor,
			boxShadow: `0px 0px 3px 0px ${theme.shadowColor}`
		}
	}, /* @__PURE__ */ React.createElement(IconComponent, { style: {
		color: theme.iconColor,
		fontSize: 28
	} }), /* @__PURE__ */ React.createElement("div", { className: "statistics-item-info" }, /* @__PURE__ */ React.createElement("div", { className: "statistics-item-title" }, errorType.title()), /* @__PURE__ */ React.createElement("div", { className: "statistics-item-count" }, count)));
};
const Statistics = (props) => {
	const { data = {
		fatal: 0,
		critical: 0,
		normal: 0,
		info: 0
	} } = props;
	return /* @__PURE__ */ React.createElement("div", { className: classNames(`${prefix}-error-tip-statistics`) }, errorTypes.map((errorType) => renderErrorItem(errorType, data[errorType.type])));
};
//#endregion
export { Statistics as default };
