
import { createContext } from 'react'
import firebase from 'firebase/app'
import 'firebase/firestore'

export const FirebaseContext = createContext<typeof Firebase | null>(null)

const config = {
    apiKey: process.env.REACT_APP_API_KEY,
    authDomain: process.env.REACT_APP_AUTH_DOMAIN,
    databaseURL: process.env.REACT_APP_DATABASE_URL,
    projectId: process.env.REACT_APP_PROJECT_ID,
    storageBucket: process.env.REACT_APP_STORAGE_BUCKET,
    messagingSenderId: process.env.REACT_APP_MESSAGING_SENDER_ID
}

const Firebase = firebase.initializeApp(config)

export default Firebase