(function () {
"use strict";
window.CO_ControllerPrompts = {
render: function (root, state) {
var el = root.querySelector(".co-prompts");
if (!el) return;
var prompts = CO_ControllerPrompts.getPrompts(state);
el.innerHTML = prompts.map(function (p) {
return (
'
' +
'' + p.key + "" +
"" + p.label + "" +
"
"
);
}).join("");
},
getPrompts: function (state) {
if (state.joinOverlay) {
if (state.joinOverlay.error) {
return [{ key: "B", label: "Dismiss" }];
}
return [];
}
if (state.activeTab === "direct-connect") {
return [
{ key: "A", label: "Connect" },
{ key: "B", label: "Back" }
];
}
var base = [
{ key: "A", label: "Join" },
{ key: "X", label: "Refresh" },
{ key: "Y", label: "Favorite" },
{ key: "B", label: "Back" }
];
if (state.focusZone === "tabs") {
return [
{ key: "LB", label: "Prev Tab" },
{ key: "RB", label: "Next Tab" },
{ key: "B", label: "Back" }
];
}
return base;
}
};
})();