import Cookies from "js-cookie";
const key = "Purchase-Console-";

const TokenKey = `${key}oken`;
const MenuKey = `${key}Menu`;
const BtnKey = `${key}MenuBtn`;
const NoticeKey = `${key}Notice`;
const UserIdKey = `${key}UserId`;
const businessCompanyNoKey = `${key}businessCompanyNo`;
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 getUserId() {
  return Cookies.get(UserIdKey);
}

export function setUserId(id) {
  return Cookies.set(UserIdKey, id);
}

export function removeUserId() {
  return Cookies.remove(UserIdKey);
}

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 get_business_companyNo() {
  return Cookies.get(businessCompanyNoKey);
}

export function set_business_companyNo(has) {
  return Cookies.set(businessCompanyNoKey, has);
}

export function remove_business_companyNo() {
  return Cookies.remove(businessCompanyNoKey);
}

