import Cookies from 'js-cookie'

const TokenKey = 'Admin_szzs-Token'

export function getToken() {
  if (import.meta.env.VITE_APP_ENV === 'development') {
    return 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJsb2dpblR5cGUiOiJsb2dpbiIsImxvZ2luSWQiOiJzeXNfdXNlcjoxNzgyNTg2MTMxNzc1MzU2OTI5Iiwicm5TdHIiOiJUWENhb3V3akoxMlZDV3V6Y0ppTzZiSmhwWHhCNUJTVCIsInVzZXJJZCI6MTc4MjU4NjEzMTc3NTM1NjkyOX0.VftlmhbHmutLybIWA9ca16ho1Lq-oXDakJFPpWlKQFU'
  } else {
    return Cookies.get(TokenKey)
  }
}

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

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