import { c } from "react-compiler-runtime";
import React, { useState } from "react";
import { Typography, makeStyles } from "@material-ui/core";
import PropTypes from "prop-types";
//#region src/componentSystems/multiThreadTimeline/ui/TimelineToggleButton.jsx
/**
* @returns {import('@material-ui/core/styles').WithStyles<import('@material-ui/core/styles/withStyles').Styles<any, {}, string>>}
*/
const useStyles = makeStyles((theme) => ({
	root: {
		display: "flex",
		alignItems: "center",
		cursor: "pointer"
	},
	off: { opacity: .5 }
}));
const TimelineToggleButton = (t0) => {
	const $ = c(17);
	const { title, handleClick, icon, off } = t0;
	const classes = useStyles();
	const [filter, setFilter] = useState(true);
	let t1;
	if ($[0] !== filter) {
		t1 = () => {
			setFilter(!filter);
		};
		$[0] = filter;
		$[1] = t1;
	} else t1 = $[1];
	const selectFilter = t1;
	const t2 = off && classes.off;
	let t3;
	if ($[2] !== icon || $[3] !== t2) {
		t3 = /* @__PURE__ */ React.createElement("div", { className: t2 }, icon);
		$[2] = icon;
		$[3] = t2;
		$[4] = t3;
	} else t3 = $[4];
	let t4;
	if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
		t4 = {
			marginTop: -4,
			marginRight: 48
		};
		$[5] = t4;
	} else t4 = $[5];
	const t5 = !filter && "line-through";
	let t6;
	if ($[6] !== t5) {
		t6 = { textDecoration: t5 };
		$[6] = t5;
		$[7] = t6;
	} else t6 = $[7];
	let t7;
	if ($[8] !== t6 || $[9] !== title) {
		t7 = /* @__PURE__ */ React.createElement("div", { style: t4 }, /* @__PURE__ */ React.createElement(Typography, {
			variant: "caption",
			style: t6
		}, title));
		$[8] = t6;
		$[9] = title;
		$[10] = t7;
	} else t7 = $[10];
	let t8;
	if ($[11] !== classes.root || $[12] !== handleClick || $[13] !== selectFilter || $[14] !== t3 || $[15] !== t7) {
		t8 = /* @__PURE__ */ React.createElement("div", {
			className: classes.root,
			onClick: handleClick,
			onMouseUp: selectFilter
		}, t3, t7);
		$[11] = classes.root;
		$[12] = handleClick;
		$[13] = selectFilter;
		$[14] = t3;
		$[15] = t7;
		$[16] = t8;
	} else t8 = $[16];
	return t8;
};
TimelineToggleButton.propTypes = {
	title: PropTypes.string.isRequired,
	timelineItem: PropTypes.object,
	handleClick: PropTypes.func.isRequired,
	icon: PropTypes.node.isRequired,
	off: PropTypes.bool
};
//#endregion
export { TimelineToggleButton };

//# sourceMappingURL=TimelineToggleButton.mjs.map