import { initAppSwitcher as e } from "../app-switcher/index.js";
import { t } from "../utils-B7XIe3qq.js";
import * as n from "react";
import { jsx as r, jsxs as i } from "react/jsx-runtime";
//#region src/react/app-switcher.tsx
function a({ apps: a, getApps: o, className: s }) {
	let c = n.useRef(null);
	return n.useEffect(() => {
		if (typeof document > "u" || !c.current) return;
		let t = {};
		a !== void 0 && (t.apps = a), o !== void 0 && (t.getApps = o), e(t);
	}, [a, o]), /* @__PURE__ */ i("div", {
		ref: c,
		"data-app-switcher": !0,
		"data-slot": "app-switcher",
		className: t("app-switcher", s),
		hidden: !0,
		children: [/* @__PURE__ */ i("button", {
			type: "button",
			className: "app-switcher__trigger",
			"aria-haspopup": "menu",
			"aria-expanded": "false",
			children: [/* @__PURE__ */ r("span", {
				"data-app-switcher-icon": !0,
				"aria-hidden": "true"
			}), /* @__PURE__ */ r("span", { "data-app-switcher-current": !0 })]
		}), /* @__PURE__ */ r("div", {
			className: "app-switcher__panel",
			role: "menu",
			children: /* @__PURE__ */ r("div", {
				"data-app-switcher-grid": !0,
				className: "app-switcher__grid"
			})
		})]
	});
}
function o({ apps: e, getApps: t, className: i }) {
	let o = n.useMemo(() => e ? e.map((e) => e.id).join(",") : "getApps", [e]);
	return /* @__PURE__ */ r(a, {
		...e === void 0 ? {} : { apps: e },
		...t === void 0 ? {} : { getApps: t },
		...i === void 0 ? {} : { className: i }
	}, o);
}
o.displayName = "AppSwitcher";
//#endregion
export { o as AppSwitcher };

//# sourceMappingURL=app-switcher.js.map