import { FluentIconButton } from "../../inputs/buttons/FluentIconButton.mjs";
import { getIconFromName } from "../../../utilities/tree/TreeUtilities.mjs";
import { c } from "react-compiler-runtime";
import React from "react";
import { Divider, Grid, Typography, lighten, makeStyles } from "@material-ui/core";
//#region src/UI/mapLayout/ui/Statistic.jsx
const useStyles = makeStyles((theme) => ({
	icon: {
		margin: "auto 5px auto 0",
		padding: theme.spacing(1),
		backgroundColor: (props) => lighten(props?.color ? props.color : theme.palette.info.main, .9),
		borderRadius: theme.spacing(3)
	},
	valueContainer: { marginRight: theme.spacing(1) },
	iconColor: {
		color: (props) => props?.color,
		borderRadius: theme.spacing(3)
	}
}));
const Statistic = (props) => {
	const $ = c(21);
	const { icon, value, title, color, onClick, hideDivider: t0 } = props;
	const hideDivider = t0 === void 0 ? false : t0;
	let t1;
	if ($[0] !== color) {
		t1 = { color };
		$[0] = color;
		$[1] = t1;
	} else t1 = $[1];
	const classes = useStyles(t1);
	let t2;
	if ($[2] !== hideDivider) {
		t2 = !hideDivider && /* @__PURE__ */ React.createElement(Grid, { item: true }, /* @__PURE__ */ React.createElement(Divider, {
			orientation: "vertical",
			variant: "middle"
		}));
		$[2] = hideDivider;
		$[3] = t2;
	} else t2 = $[3];
	let t3;
	if ($[4] !== classes.icon || $[5] !== classes.iconColor || $[6] !== icon || $[7] !== onClick) {
		t3 = icon && /* @__PURE__ */ React.createElement(Grid, {
			item: true,
			className: classes.icon
		}, /* @__PURE__ */ React.createElement(FluentIconButton, {
			icon: getIconFromName(icon),
			className: classes.iconColor,
			onClick
		}));
		$[4] = classes.icon;
		$[5] = classes.iconColor;
		$[6] = icon;
		$[7] = onClick;
		$[8] = t3;
	} else t3 = $[8];
	let t4;
	if ($[9] !== value) {
		t4 = /* @__PURE__ */ React.createElement(Typography, { variant: "h5" }, value);
		$[9] = value;
		$[10] = t4;
	} else t4 = $[10];
	let t5;
	if ($[11] !== title) {
		t5 = /* @__PURE__ */ React.createElement(Typography, { variant: "caption" }, title);
		$[11] = title;
		$[12] = t5;
	} else t5 = $[12];
	let t6;
	if ($[13] !== classes.valueContainer || $[14] !== t4 || $[15] !== t5) {
		t6 = /* @__PURE__ */ React.createElement(Grid, {
			item: true,
			className: classes.valueContainer
		}, t4, t5);
		$[13] = classes.valueContainer;
		$[14] = t4;
		$[15] = t5;
		$[16] = t6;
	} else t6 = $[16];
	let t7;
	if ($[17] !== t2 || $[18] !== t3 || $[19] !== t6) {
		t7 = /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(Grid, { container: true }, t2, t3, t6));
		$[17] = t2;
		$[18] = t3;
		$[19] = t6;
		$[20] = t7;
	} else t7 = $[20];
	return t7;
};
//#endregion
export { Statistic };

//# sourceMappingURL=Statistic.mjs.map