/* eslint-disable react/prop-types */
import React, { createContext, useState } from 'react';

export const Context = createContext();

export default (props) => {
  const { value, children } = props;
  const [bannerIsActive, setBannerActive] = useState(false);
  const [cookieAccepted, setCookieAccepted] = useState(true);

  return (
    <Context.Provider
      value={{
        translations: value.translations,
        bannerIsActive,
        setBannerActive,
        cookieAccepted,
        setCookieAccepted,
      }}
    >
      {children}
    </Context.Provider>
  );
};
