import Cookies from "js-cookie";

const TokenKey = "Purchase-Client-Console-Token";
const MenuKey = "Purchase-Client-Console-Menu";
const BtnKey = "Purchase-Client-Console-MenuBtn";
const NoticeKey = "Purchase-Client-Console-Notice";
const mainMenuKey = "Purchase-Client-Console-MainMenu";
const businessCompanyKey = "Purchase-Client-Console-businessCompany";
const businessCompanyNoKey = "Purchase-Client-Console-businessCompanyNo";
const privateFieldKey = "Purchase-Client-Console-privateField";
const actionDataKey = "Purchase-Client-Console-actionData";
const companyListKey="Purchase-Client-Console-companyList";
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 getMainList() {
  return Cookies.get(mainMenuKey);
}

export function setMainList(has) {
  return Cookies.set(mainMenuKey, has);
}

export function removeMainList() {
  return Cookies.remove(mainMenuKey);
}

export function get_business_company() {
  return Cookies.get(businessCompanyKey);
}

export function set_business_company(has) {
  return Cookies.set(businessCompanyKey, has);
}

export function remove_business_company() {
  return Cookies.remove(businessCompanyKey);
}
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);
}

export function get_company_list() {
  return Cookies.get(companyListKey);
}

export function set_company_list(has) {
  return Cookies.set(companyListKey, has);
}

export function remove_company_list() {
  return Cookies.remove(companyListKey);
}



export function get_private_field() {
  return Cookies.get(privateFieldKey);
}

export function set_private_field(has) {
  return Cookies.set(privateFieldKey, has);
}

export function remove_private_field() {
  return Cookies.remove(privateFieldKey);
}

export function get_action_data() {
  return Cookies.get(actionDataKey);
}

export function set_action_data(has) {
  return Cookies.set(actionDataKey, has);
}

export function remove_action_data() {
  return Cookies.remove(actionDataKey);
}
