import { c } from "react-compiler-runtime";
import React from "react";
import { ButtonBase, Tooltip, Typography, makeStyles } from "@material-ui/core";
import PropTypes from "prop-types";
//#region src/UI/inputs/buttons/ToolBarButton.jsx
const useStyles = makeStyles((theme) => ({
	root: { borderBottom: (props) => props.selected && `2px solid ${theme.palette.secondary.main}` },
	wrapper: {
		display: "flex",
		flexDirection: "row",
		marginRight: theme.spacing(2)
	},
	icon: {
		fontSize: 16,
		width: 16,
		height: 16,
		color: (props) => props.disabled ? theme.palette.action.disabled : theme.palette.secondary.main
	},
	iconWrapper: {
		background: theme.palette.common.white,
		borderRadius: 100,
		padding: theme.spacing(1)
	},
	label: {
		marginLeft: theme.spacing(1),
		fontSize: "0.875rem",
		"&:hover": { color: theme.palette.secondary.main }
	}
}), { name: "ToolBarButton" });
const ToolBarButton = (props) => {
	const $ = c(23);
	const classes = useStyles(props);
	const { component: ToolBarComponent, click, label, expanded, aria, icon: t0, disabled: t1 } = props;
	const icon = t0 === void 0 ? true : t0;
	const disabled = t1 === void 0 ? false : t1;
	const t2 = expanded && label || aria || "";
	const t3 = !expanded && 5e3;
	let t4;
	if ($[0] !== classes.root) {
		t4 = { root: classes.root };
		$[0] = classes.root;
		$[1] = t4;
	} else t4 = $[1];
	let t5;
	if ($[2] !== ToolBarComponent || $[3] !== classes.icon || $[4] !== classes.iconWrapper || $[5] !== icon) {
		t5 = icon && /* @__PURE__ */ React.createElement("div", { className: classes.iconWrapper }, /* @__PURE__ */ React.createElement(ToolBarComponent, { className: classes.icon }));
		$[2] = ToolBarComponent;
		$[3] = classes.icon;
		$[4] = classes.iconWrapper;
		$[5] = icon;
		$[6] = t5;
	} else t5 = $[6];
	const t6 = !expanded && label;
	let t7;
	if ($[7] !== classes.label || $[8] !== t6) {
		t7 = /* @__PURE__ */ React.createElement(Typography, {
			variant: "body2",
			className: classes.label
		}, t6);
		$[7] = classes.label;
		$[8] = t6;
		$[9] = t7;
	} else t7 = $[9];
	let t8;
	if ($[10] !== aria || $[11] !== classes.wrapper || $[12] !== click || $[13] !== disabled || $[14] !== t4 || $[15] !== t5 || $[16] !== t7) {
		t8 = /* @__PURE__ */ React.createElement(ButtonBase, {
			classes: t4,
			className: classes.wrapper,
			onClick: click,
			disableRipple: true,
			"aria-label": aria,
			disabled
		}, t5, t7);
		$[10] = aria;
		$[11] = classes.wrapper;
		$[12] = click;
		$[13] = disabled;
		$[14] = t4;
		$[15] = t5;
		$[16] = t7;
		$[17] = t8;
	} else t8 = $[17];
	let t9;
	if ($[18] !== label || $[19] !== t2 || $[20] !== t3 || $[21] !== t8) {
		t9 = /* @__PURE__ */ React.createElement(Tooltip, {
			title: t2,
			"aria-label": label,
			placement: "top",
			enterDelay: t3
		}, t8);
		$[18] = label;
		$[19] = t2;
		$[20] = t3;
		$[21] = t8;
		$[22] = t9;
	} else t9 = $[22];
	return t9;
};
ToolBarButton.propTypes = {
	component: PropTypes.func,
	click: PropTypes.func,
	label: PropTypes.string,
	expanded: PropTypes.bool,
	aria: PropTypes.string,
	icon: PropTypes.bool
};
//#endregion
export { ToolBarButton };

//# sourceMappingURL=ToolBarButton.mjs.map