import useTranslation from "next-translate/useTranslation";
import Head from "next/head";
import { useEffect } from "react";
import { useRouter } from "next/router";
import { connect, useDispatch } from "react-redux";
import Breadcrumbs from "../../components/breadcrumbs";
import CookieBanner from "../../components/cookieBanner";
import Footer from "../../components/footer";
import Header from "../../components/header";
import Case from "../../components/representation";
import { wrapper } from "../../store/store";
import { getSession, useSession, signIn } from "next-auth/react";
import {
consoleLogger,
getPersonalAccount,
getPortalLogin,
} from "../../actions";
import {
setRepresentationCapacity,
setRepresentationSubmit,
setSubmitBack,
setRepresentationSubmitConfirmation,
} from "../../store/currentView/action";
import {
setAccountDetails,
setContainerID,
setLoggedInUserId,
} from "../../store/accountDetails/action";
import NoSessionWarning from "../../components/nosession";
const Home = (props) => {
const { footerLinks, pages } = props;
let { t, lang } = useTranslation();
const router = useRouter();
const { locale } = router;
const { appealtypes } = router.query;
const dispatch = useDispatch();
// useEffect(() => {
// const updateAccountStore = async () => {
// const thisSession = await getSession();
// if (thisSession) {
// let loggedInUser = await getPortalLogin(thisSession.user.email);
// dispatch(
// setAccountDetails(
// await getPersonalAccount(
// loggedInUser.value[0].contactid
// )
// )
// );
// dispatch(setContainerID(thisSession.user.id));
// //dispatch(setRepresentationSubmit(true));
// }
// };
// updateAccountStore();
// }, [dispatch]);
const { data: session, status } = useSession();
if (status === "loading") {
return