import Cookies from 'js-cookie'

const TokenKey = 'x-token'
const KeyInfo = 'x-keyinfo'
const InitState = 'x-init'
const NameKey = 'x-name'

export function getToken() {
  return Cookies.get(TokenKey)
}

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

export function getKey() {
  return Cookies.get(KeyInfo)
}

export function setKey(key) {
  return Cookies.set(KeyInfo, key)
}

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

export function getUserInit() {
  return Cookies.get(InitState)
}

export function setUserInit(token) {
  return Cookies.set(InitState, token)
}

export function removeUserInit() {
  return Cookies.remove(InitState)
}

export function getName() {
  return Cookies.get(NameKey)
}

export function setName(name) {
  return Cookies.set(NameKey, name)
}

export function removeName() {
  return Cookies.remove(NameKey)
}
