import includes from 'lodash/includes'

export type ENVType = NodeJS.ProcessEnv['REACT_APP_ENV']

const apis: Array<ENVType> = ['staging', 'preproduction', 'production']

export const isValidEnv = (value: string): value is ENVType => (
  Boolean(value) && includes(apis, value)
)

export const ENV = process.env.REACT_APP_ENV || 'staging'

export const isProduction = ENV === 'production' || ENV === 'preproduction'

export const stageENV = process.env.REACT_APP_STAGE || 'staging'

export const STRIPE_PUBLIC_KEY = process.env.REACT_APP_STRIPE_PK || 'pk_test_51J5TEYEDSxVnTgDWhKLstuDAhx9XmGJmj2awyZ1HghpWdU46MhXqbQt1PyW9XsRlES5JFyuQWbPRjoSsiW3wvXOH00KMirJEGZ'

export const GOOGLE_CLIENT_ID = process.env.REACT_APP_GOOGLE_CLIENT_ID || '1043133237396-kebgih109kro71b5c7c8qphtgjbd2gdk.apps.googleusercontent.com'
export const FACEBOOK_CLIENT_ID = process.env.REACT_APP_FACEBOOK_CLIENT_ID || '798254931203361'
