import ProductAppListItem from "./ProductAppListItem.mjs";
import { c } from "react-compiler-runtime";
import React from "react";
import { Typography, makeStyles } from "@material-ui/core";
import { useTranslation } from "react-i18next";
import "@material-ui/icons/esm/ArrowForward";
//#region src/shell/ui/appSwitcher/ProductAppList.jsx
const useStyles = makeStyles((theme) => ({
	root: {
		"& > *": { margin: theme.spacing(.5) },
		display: "flex",
		flexWrap: "wrap"
	},
	icons: { color: (props) => props.color },
	buttonGroup: {
		display: "flex",
		marginRight: theme.spacing(3),
		width: 170
	},
	label: {
		color: theme.palette.getContrastText(theme.palette.secondary.light),
		marginTop: theme.spacing(2)
	},
	title: {
		color: theme.palette.getContrastText(theme.palette.secondary.light),
		minWidth: 320
	},
	moreAppContainer: { width: "100%" },
	moreApps: {
		color: theme.palette.getContrastText(theme.palette.secondary.light),
		display: "flex",
		flexDirection: "row",
		justifyContent: "flex-end"
	},
	arrow: {
		size: 18,
		marginLeft: theme.spacing(1)
	}
}));
const ProductAppList = (props) => {
	const $ = c(13);
	const classes = useStyles(props);
	const { apps, user } = props;
	const { t } = useTranslation();
	let t0;
	if ($[0] !== classes || $[1] !== t) {
		t0 = (props_0) => {
			const { title, apps: apps_0 } = props_0;
			return /* @__PURE__ */ React.createElement("div", { className: classes.root }, /* @__PURE__ */ React.createElement(Typography, {
				variant: "h6",
				className: classes.title
			}, t(title)), apps_0);
		};
		$[0] = classes;
		$[1] = t;
		$[2] = t0;
	} else t0 = $[2];
	const AppGroup = t0;
	let t1;
	if ($[3] !== apps || $[4] !== t || $[5] !== user) {
		let t2;
		if ($[7] !== t || $[8] !== user) {
			t2 = (item) => /* @__PURE__ */ React.createElement(ProductAppListItem, {
				key: item.id,
				label: t(item.label),
				redirectInfo: item.redirectInfo,
				image: item.image,
				icon: item.icon,
				user,
				getAccessToken: item.getAccessToken
			});
			$[7] = t;
			$[8] = user;
			$[9] = t2;
		} else t2 = $[9];
		t1 = apps.map(t2);
		$[3] = apps;
		$[4] = t;
		$[5] = user;
		$[6] = t1;
	} else t1 = $[6];
	let t2;
	if ($[10] !== AppGroup || $[11] !== t1) {
		t2 = /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(AppGroup, { apps: t1 }));
		$[10] = AppGroup;
		$[11] = t1;
		$[12] = t2;
	} else t2 = $[12];
	return t2;
};
//#endregion
export { ProductAppList as default };

//# sourceMappingURL=ProductAppList.mjs.map