import * as React from 'react';
import { createContext, Context, FC } from 'react';

export interface IRouterProps {
  hideHead?: boolean;
  hideSide?: boolean;
  hideFoot?: boolean;
  hideAll?: boolean;
}

export const RouterContext: Context<IRouterProps> = createContext<IRouterProps>(
  {
    hideHead: false,
    hideSide: false,
    hideFoot: false,
    hideAll: false,
  },
);

const ProviderHoc = (props: IRouterProps) => (Com: FC<any>) => {
  return () => {
    return (
      <RouterContext.Provider value={props}>
        <Com />
      </RouterContext.Provider>
    );
  };
};

export default ProviderHoc;
