import React, { useEffect } from "react"; import { useDispatch } from "react-redux"; import Layout from "../../../components/layout/Layout"; import BusinessDetails from "../../../components/vendor/BusinessDetails"; import { loadUser } from "../../../redux/actions/userActions"; import { getVendorDetails } from "../../../redux/actions/vendorActions"; import { wrapper } from "../../../redux/store"; import { GenericLayout } from "../../../components/layout/Generics/GenericLayout"; // import { loadUser } from "../redux/actions/userActions"; // import { wrapper } from "../redux/store"; export default function BusinessDetailsPage() { const dispatch = useDispatch(); useEffect(() => { dispatch(getVendorDetails()); }, []); return ( // <Layout> <GenericLayout> <BusinessDetails /> </GenericLayout> // </Layout> ); } /** For server side rendering */ export const getServerSideProps = wrapper.getServerSideProps(store => async ({ req, query }) => { // Get the menu data. // get the locations data. await store.dispatch(loadUser()); return { props: {} }; });