import devices from "./components/screens/devices/devices.js";
import scripts from "./components/screens/scripts/scripts.js";
import areas from "./components/screens/areas/areas.js";

function routes(screens, sh_api) {
	screens.add("/", {
		alias: "home",
		renderer: () => {
			return ``;
		},
		initer: scr => {
			document.location = "/#!/areas/favorites";
		}
	});

	screens.add("-", {
		alias: "not-found-screen",
		renderer: () => {
			return `<div class="container"><h2 class="mt-4">404 NOT FOUND</h2></div>`;
		},
		initer: scr => {
			scr.ready();
		}
	});

	screens.add("/devices", devices.list(sh_api));
	screens.add("/devices/scanning", devices.scanning(sh_api));
	screens.add("/scripts/scopes", scripts.scopes(sh_api));
	screens.add("/scripts/regular", scripts.regular(sh_api));
	screens.add("/scripts/actions", scripts.actions(sh_api));
	screens.add("/areas/tree", areas.areasTree(sh_api));
	screens.add("/areas/favorites", areas.areasFavorites(sh_api));
}

export {
	routes
}