import firebase from 'react-native-firebase';
import { RootState } from '../models';
import { applicationLogic } from './application';
import { authLogic } from './auth';
import { chatLogic } from './chat';
import { employeeLogic } from './employee';
import { employerLogic } from './employer';
import { navigationLogic } from './navigation';
import { notificationLogic } from './notification';
import { offerLogic } from './offer';
import { userLogic } from './user';

export const logic = [
  ...authLogic,
  ...navigationLogic,
  ...userLogic,
  ...offerLogic,
  ...applicationLogic,
  ...employerLogic,
  ...employeeLogic,
  ...chatLogic,
  ...notificationLogic,
];

export interface LogicDeps {
  getState: () => RootState;
}

const environment = __DEV__ ? 'development' : 'production';
export const Firestore = firebase.app().firestore().collection('env').doc(environment);
export const Storage = firebase.app().storage().ref('env').child(environment);
