import Link from "next/link";
import _ from "lodash";
import Head from "next/head";
import Header from "../../components/header";
import Banner from "../../components/banner";
import CookieBanner from "../../components/cookieBanner";
import Breadcrumbs from "../../components/breadcrumbs";
import Footer from "../../components/footer";
import { useSelector, shallowEqual, connect } from "react-redux";
import { wrapper } from "../../store/store";
import Cookies from "cookies";
import { useRouter } from "next/router";
import { useState } from "react";
import useTranslation from "next-translate/useTranslation";
import jsonpath from "jsonpath";
import { reduxForm, formValueSelector } from "redux-form";
import RegisterForm from "../../components/account/registerform";
import xpath from "xpath";
import {
setAppealType,
setAppealTypeTitle,
setAppealTypeID,
setAppealLPA,
getAppealTypeObj,
} from "../../store/appealType/action";
import { getAppealsTypes, getLPA } from "../../actions";
import { setLPA } from "../../store/lpa/action";
const Home = (props) => {
const { footerLinks, pages, formData } = props;
let { t, lang } = useTranslation();
const router = useRouter();
const { locale } = router;
const { appealtypes } = router.query;
const { appealType, LPAData } = props;
return (
{t("search:page-title")} - {t("common:service-name")}
Create a new account
Help
Companies or submissions by more
than one individual (groups)
If you are submitting an appeal or
representation from a company e.g.
"Acme Inc" or a group of
people e.g. "Residents of 1-10
High street", you should enter
the name of the company or group in
the Company/Group field. You will be
deemed as acting as their
representative.
Enforcement appeals by married/civil
partnership couples
You should not enter a group name.
You need only enter your
partner's name on the appeal
form itself as an additional
appellant.
Other appeals by married/civil
partnership couples
For any other type of appeal, for
example a planning appeal, you
should enter a group name when
creating your account e.g. "Mr
and Mrs Smith", if that is the
name on the application.
);
};
export const getServerSideProps = wrapper.getServerSideProps(
(store) =>
async ({ query, req, res }) => {
const appealTypeData = await getAppealsTypes();
const lpaData = await getLPA();
console.log("appeal types", appealTypeData);
console.log("lpa typeswwwww", lpaData);
store.dispatch(setAppealType(appealTypeData));
store.dispatch(setLPA(lpaData));
}
);
const mapStateToProps = (state) => {
return {
search: state.search,
searchResultsObj: state.searchResultsObj,
formData: state.formData,
appealType: state.appealType,
LPAData: state.LPAData,
form: state.form,
};
};
export default connect(mapStateToProps)(Home);