import { FluentIcon } from "../../../utilities/iconLibrary/FluentIcon.mjs";
import { redirectToLinkOnClick } from "../../../utilities/menus/redirectToLink.mjs";
import { c } from "react-compiler-runtime";
import React, { useState } from "react";
import { IconButton, makeStyles } from "@material-ui/core";
//#region src/shell/ui/appSwitcher/ProductAppListItem.jsx
const useStyles = makeStyles((theme) => ({
	icons: { color: (props) => props.color },
	buttonGroup: {
		display: "flex",
		alignItems: "center",
		marginBottom: "16px !important",
		width: 190
	},
	label: { paddingLeft: theme.spacing(3) },
	images: {
		width: theme.spacing(3),
		height: theme.spacing(3),
		cursor: "pointer",
		color: "lightslategray"
	}
}));
const ProductAppListItem = (props) => {
	const $ = c(14);
	const classes = useStyles(props);
	const { label, redirectInfo, image, icon, getAccessToken, user } = props;
	const [open, setOpen] = useState(false);
	let t0;
	if ($[0] !== getAccessToken || $[1] !== open || $[2] !== redirectInfo || $[3] !== user) {
		t0 = () => {
			redirectToLinkOnClick(redirectInfo, getAccessToken, user);
			setOpen(!open);
		};
		$[0] = getAccessToken;
		$[1] = open;
		$[2] = redirectInfo;
		$[3] = user;
		$[4] = t0;
	} else t0 = $[4];
	const handleClick = t0;
	let t1;
	if ($[5] !== classes.buttonGroup || $[6] !== classes.icons || $[7] !== classes.images || $[8] !== classes.label || $[9] !== handleClick || $[10] !== icon || $[11] !== image || $[12] !== label) {
		t1 = image ? /* @__PURE__ */ React.createElement("div", { className: classes.buttonGroup }, /* @__PURE__ */ React.createElement(IconButton, {
			className: classes.icons,
			onClick: handleClick
		}, /* @__PURE__ */ React.createElement("img", {
			src: image,
			alt: label,
			className: classes.images
		})), /* @__PURE__ */ React.createElement("div", { className: classes.label }, label)) : /* @__PURE__ */ React.createElement("div", { className: classes.buttonGroup }, icon && /* @__PURE__ */ React.createElement(FluentIcon, {
			component: icon,
			className: classes.images,
			onClick: handleClick
		}), /* @__PURE__ */ React.createElement("div", { className: classes.label }, label));
		$[5] = classes.buttonGroup;
		$[6] = classes.icons;
		$[7] = classes.images;
		$[8] = classes.label;
		$[9] = handleClick;
		$[10] = icon;
		$[11] = image;
		$[12] = label;
		$[13] = t1;
	} else t1 = $[13];
	return t1;
};
//#endregion
export { ProductAppListItem as default };

//# sourceMappingURL=ProductAppListItem.mjs.map