doctor-on-call.js 1.2 KB
import React from "react";
import { createWrapper } from "next-redux-wrapper";
import Image from "next/image";
const DoctorOnCall = () => {
  return (
    <div>
      <h1>Hello world</h1>
      <span className=""></span>
      <Image width="3000px" height="600px" src="/banner/abu-faqs-d.png"></Image>
    </div>
  );
};

export default DoctorOnCall;

const bindMiddleware = middleware => {
  if (process.env.NODE_ENV !== "production") {
    const { composerWithDevTools, composeWithDevTools } = require("redux-devtools-extension");
    return composeWithDevTools(applyMiddleware(...middleware));
  }

  return applyMiddleware(...middleware);
};

const reducer = (state, action) => {
  if (action.type === HYDRATE) {
    const nextState = { ...state, ...action.payload };
    return nextState;
  } else {
    return reducers(state, action);
  }
};

const initStore = () => {
  return createStore(reducer, bindMiddleware([thunkMiddleware]));
};

export const wrapper = createWrapper(initStore);
/** For server side rendering */
export const getStaticProps = wrapper.getStaticProps(
  (store) =>
    async ({ req, query }) => {
      // Get the menu data.

      return {
        props: {},
        revalidate: 100,
      };
    }
);