import { FluentIcon } from "../../../utilities/iconLibrary/FluentIcon.mjs";
import { c } from "react-compiler-runtime";
import React, { forwardRef } from "react";
import { Chip, Tooltip, Typography, makeStyles } from "@material-ui/core";
import PropTypes from "prop-types";
//#region src/UI/inputs/buttons/AmbientChipButton.jsx
const useStyles = makeStyles((theme) => ({
	root: {},
	actionHeader: {
		display: "flex",
		flexDirection: "row"
	},
	icon: {
		marginLeft: theme.spacing(1),
		color: (props) => props.background === "transparent" ? theme.palette.secondary.main : theme.palette.primary.main
	},
	chipRoot: { background: (props) => props.background ? props.background : theme.palette.common.white },
	label: {
		overflow: "hidden",
		whiteSpace: "nowrap",
		textOverflow: "ellipsis"
	}
}));
const AmbientChipButton = forwardRef(function AmbientChipButton(props, ref) {
	const $ = c(22);
	const { tooltip, label, onClick, icon, iconClassName, className, labelClassName, otherProps, id: t0, udprecordid } = props;
	const id = t0 === void 0 ? "chip-button" : t0;
	const classes = useStyles(props);
	const t1 = className ?? classes.chipRoot;
	const t2 = labelClassName ?? classes.label;
	let t3;
	if ($[0] !== label || $[1] !== t2) {
		t3 = /* @__PURE__ */ React.createElement(Typography, { className: t2 }, label);
		$[0] = label;
		$[1] = t2;
		$[2] = t3;
	} else t3 = $[2];
	let t4;
	if ($[3] !== classes.icon || $[4] !== icon || $[5] !== iconClassName) {
		t4 = icon && /* @__PURE__ */ React.createElement(FluentIcon, {
			className: iconClassName ?? classes.icon,
			component: icon
		});
		$[3] = classes.icon;
		$[4] = icon;
		$[5] = iconClassName;
		$[6] = t4;
	} else t4 = $[6];
	let t5;
	if ($[7] !== id || $[8] !== onClick || $[9] !== otherProps || $[10] !== ref || $[11] !== t1 || $[12] !== t3 || $[13] !== t4 || $[14] !== udprecordid) {
		t5 = /* @__PURE__ */ React.createElement(Chip, {
			id,
			udprecordid,
			ref,
			className: t1,
			label: t3,
			onClick,
			icon: t4,
			...otherProps
		});
		$[7] = id;
		$[8] = onClick;
		$[9] = otherProps;
		$[10] = ref;
		$[11] = t1;
		$[12] = t3;
		$[13] = t4;
		$[14] = udprecordid;
		$[15] = t5;
	} else t5 = $[15];
	let t6;
	if ($[16] !== t5 || $[17] !== tooltip) {
		t6 = /* @__PURE__ */ React.createElement(Tooltip, { title: tooltip }, t5);
		$[16] = t5;
		$[17] = tooltip;
		$[18] = t6;
	} else t6 = $[18];
	let t7;
	if ($[19] !== classes.root || $[20] !== t6) {
		t7 = /* @__PURE__ */ React.createElement("div", { className: classes.root }, t6);
		$[19] = classes.root;
		$[20] = t6;
		$[21] = t7;
	} else t7 = $[21];
	return t7;
});
AmbientChipButton.propTypes = {
	tooltip: PropTypes.string.isRequired,
	label: PropTypes.string.isRequired,
	onClick: PropTypes.func,
	icon: PropTypes.func.isRequired
};
//#endregion
export { AmbientChipButton };

//# sourceMappingURL=AmbientChipButton.mjs.map