import type { Component } from "solid-js";
import AppRouter from "./routes";

import SuperTokens from "supertokens-web-js";
import EmailPass from "supertokens-web-js/recipe/emailpassword";
import Session from "supertokens-web-js/recipe/session";
import AuthProvider from "./context/AuthContext";

SuperTokens.init({
  appInfo: {
    apiDomain: "http://localhost:3300",
    apiBasePath: "/auth/api",
    appName: "Fluxem",
  },
  recipeList: [EmailPass.init(), Session.init()],
});

const App: Component = () => {
  return (
    <AuthProvider>
      <AppRouter />
    </AuthProvider>
  );
};

export default App;
