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_fkEjSoWfJXuCwMgwHRpbOGPt'
