function getCookie(name) {
  const cookieStr = document.cookie;
  const cookies = cookieStr.split("; ");

  for (const cookie of cookies) {
    const [key, value] = cookie.split("=");
    if (key === name) return decodeURIComponent(value);
  }

  return null; // Not found
}

export default getCookie;
