import { TimelineHoverCard } from "./TimelineHoverCard.mjs";
import { c } from "react-compiler-runtime";
import React, { useState } from "react";
import { makeStyles, useTheme } from "@material-ui/core";
import clsx from "clsx";
import PropTypes from "prop-types";
//#region src/componentSystems/multiThreadTimeline/ui/VisualizationDot.jsx
const useStyles = makeStyles((theme) => ({
	root: {
		minHeight: theme.spacing(1.25),
		minWidth: theme.spacing(1.25),
		borderRadius: 25,
		cursor: (props) => props.hover && "pointer"
	},
	multi: {
		padding: 11,
		paddingTop: 5,
		paddingBottom: 5,
		color: theme.palette.common.white
	}
}));
const VisualizationDot = (props) => {
	const $ = c(25);
	const theme = useTheme();
	const classes = useStyles(props);
	const { type, children, hover, multi, noHover } = props;
	const [showHover, setShowHover] = useState();
	let t0;
	if ($[0] !== children || $[1] !== classes || $[2] !== hover || $[3] !== multi || $[4] !== noHover || $[5] !== showHover) {
		t0 = (t1) => {
			const { color } = t1;
			return /* @__PURE__ */ React.createElement("div", {
				onMouseEnter: () => setShowHover(true),
				onMouseLeave: () => setShowHover(false),
				className: clsx(classes.root, multi && classes.multi),
				style: { background: color }
			}, children, showHover && !noHover && /* @__PURE__ */ React.createElement(TimelineHoverCard, { popover: false }, " ", hover, " "));
		};
		$[0] = children;
		$[1] = classes;
		$[2] = hover;
		$[3] = multi;
		$[4] = noHover;
		$[5] = showHover;
		$[6] = t0;
	} else t0 = $[6];
	const DotWrapper = t0;
	let dot;
	bb0: switch (type) {
		case "Late Bill": {
			let t1;
			if ($[7] !== DotWrapper || $[8] !== theme.palette.warning.light) {
				t1 = /* @__PURE__ */ React.createElement(DotWrapper, { color: theme.palette.warning.light });
				$[7] = DotWrapper;
				$[8] = theme.palette.warning.light;
				$[9] = t1;
			} else t1 = $[9];
			dot = t1;
			break bb0;
		}
		case "Disconnect": {
			let t1;
			if ($[10] !== DotWrapper || $[11] !== theme.palette.error.main) {
				t1 = /* @__PURE__ */ React.createElement(DotWrapper, { color: theme.palette.error.main });
				$[10] = DotWrapper;
				$[11] = theme.palette.error.main;
				$[12] = t1;
			} else t1 = $[12];
			dot = t1;
			break bb0;
		}
		case "Letter Sent": {
			let t1;
			if ($[13] !== DotWrapper || $[14] !== theme.palette.warning.dark) {
				t1 = /* @__PURE__ */ React.createElement(DotWrapper, { color: theme.palette.warning.dark });
				$[13] = DotWrapper;
				$[14] = theme.palette.warning.dark;
				$[15] = t1;
			} else t1 = $[15];
			dot = t1;
			break bb0;
		}
		case "Payment": {
			let t1;
			if ($[16] !== DotWrapper || $[17] !== theme.palette.success.main) {
				t1 = /* @__PURE__ */ React.createElement(DotWrapper, { color: theme.palette.success.main });
				$[16] = DotWrapper;
				$[17] = theme.palette.success.main;
				$[18] = t1;
			} else t1 = $[18];
			dot = t1;
			break bb0;
		}
		case "Arrange Pay": {
			let t1;
			if ($[19] !== DotWrapper || $[20] !== theme.palette.warning.main) {
				t1 = /* @__PURE__ */ React.createElement(DotWrapper, { color: theme.palette.warning.main });
				$[19] = DotWrapper;
				$[20] = theme.palette.warning.main;
				$[21] = t1;
			} else t1 = $[21];
			dot = t1;
			break bb0;
		}
		default: {
			let t1;
			if ($[22] !== DotWrapper || $[23] !== theme.palette.info.light) {
				t1 = /* @__PURE__ */ React.createElement(DotWrapper, { color: theme.palette.info.light });
				$[22] = DotWrapper;
				$[23] = theme.palette.info.light;
				$[24] = t1;
			} else t1 = $[24];
			dot = t1;
		}
	}
	return dot;
};
VisualizationDot.propTypes = {
	type: PropTypes.string,
	children: PropTypes.node,
	hover: PropTypes.node,
	multi: PropTypes.bool,
	noHover: PropTypes.bool
};
//#endregion
export { VisualizationDot };

//# sourceMappingURL=VisualizationDot.mjs.map