import Cookies from "js-cookie";

const TokenKey = "compute-Console-Token";
const MenuKey = "compute-Console-Menu";
const BtnKey = "compute-Console-MenuBtn";
const NoticeKey = "compute-Console-Notice";
const InfoKey = "compute-Console-Info";
const ActionKey = "compute-Console-Action";
export function getToken() {
  return Cookies.get(TokenKey);
}

export function setToken(token) {
  return Cookies.set(TokenKey, token);
}

export function removeToken() {
  return Cookies.remove(TokenKey);
}

export function getMenu() {
  const menu = Cookies.get(MenuKey);
  if (menu) {
    return JSON.parse(menu);
  } else {
    return [];
  }
}

export function setMenu(menu) {
  return Cookies.set(MenuKey, menu);
}

export function removeMenu() {
  return Cookies.remove(MenuKey);
}

export function getBtn() {
  return Cookies.get(BtnKey);
}

export function setBtn(has) {
  return Cookies.set(BtnKey, has);
}

export function removeBtn() {
  return Cookies.remove(BtnKey);
}

export function getNotice() {
  return Cookies.get(NoticeKey);
}

export function setNotice(has) {
  return Cookies.set(NoticeKey, has);
}

export function removeNotice() {
  return Cookies.remove(NoticeKey);
}

export function getAction() {
  return Cookies.get(ActionKey);
}

export function setAction(has) {
  return Cookies.set(ActionKey, has);
}

export function removeAction() {
  return Cookies.remove(ActionKey);
}
