import defaultConfig, { seedViewConfig } from 'config/seedGeneral';

import * as zeus from './graphql-zeus';

export const viewConfig = {
  ...seedViewConfig,
  colors: {
    ...seedViewConfig.colors,
    primary: '#5fb77d',
    secondary: '#364350',
  },
};

export { zeus };

let env = 'prod';
if (defaultConfig.dev) env = 'dev';
if (defaultConfig.staging) env = 'staging';
else if (defaultConfig.locale) env = 'staging';

const urls = {
  content: {
    dev: 'https://production.work-in-flex.com/content/staging-all.json',
    staging: 'https://production.work-in-flex.com/content/staging-all.json',
    prod: 'https://production.work-in-flex.com/content/staging-all.json',
  },
  app: {
    dev: 'https://dev-api.work-in-flex.com/app',
    staging: 'https://staging-api.work-in-flex.com/app',
  },
  messagerie: {
    dev: 'https://dev-api.work-in-flex.com/messaging',
    staging: 'https://staging-api.work-in-flex.com/messaging',
  },
  upload: {
    dev: 'https://rmhhz2lgyi.execute-api.eu-central-1.amazonaws.com/staging/',
    staging: 'https://rmhhz2lgyi.execute-api.eu-central-1.amazonaws.com/staging/',
  },
};

export const config = {
  ...defaultConfig,
  idKey: '_id',
  staticContent: true,
  noLogoutApi: true,
  project: "Work'in flex",
  defaultLanguage: 'fr',
  validationPath: 'general.validation',
  storage: {
    name: 'workinflex-storage',
    reducers: ['session'],
  },
  api: {
    contentUrl: urls.content[env],
    messagerieUrlApollo: urls.messagerie[env],
    baseUrlApollo: urls.app[env],
    uploadUrlApollo: urls.upload[env],
  },
  loginApollo: true,
  cmsApollo: true,
  stripeKey:
    'pk_test_51Hed0uC67iAXFvSWmAyKLSNtFmbD1HosXdjVmQ6qAbZ026THo9HSBzl2hv4MDaHVhGoD1gaHtcC1IPxQ9ApwksVy00GysNlRlK',
  googleMapKey: 'AIzaSyC4E171p0VFD-a4pP87SvpMhSpR0ChG1HY',
};

export default config;
