// Path: Frontend/src/entry-client.tsx

// @refresh reload
import { mount, StartClient } from "@solidjs/start/client";
import type { JSX } from "solid-js";
import { initializeThemeRuntime } from "./theme/runtime";

const getAppRoot = (): HTMLElement => {
	const appRoot = document.getElementById("app");

	if (!(appRoot instanceof HTMLElement)) {
		throw new Error("App root element '#app' was not found.");
	}

	return appRoot;
};

const mountApp = (): void => {
	mount((): JSX.Element => <StartClient />, getAppRoot());
};

void initializeThemeRuntime();

mountApp();
