const getCookie = (name) => {
  name = name + "=";
  let decodedCookie = decodeURIComponent(document.cookie);
  let cookie = decodedCookie.split(";");

  for (let i = 0; i < cookie.length; i++) {
    let c = cookie[i];
    while (c.charAt(0) === " ") {
      c = c.substring(1);
    }
    if (c.indexOf(name) === 0) {
      return c.substring(name.length, c.length);
    }
  }
  return "";
};

export default getCookie;
