import { initializeApp } from 'firebase/app';
import { getAuth } from 'firebase/auth';
import { getFirestore } from 'firebase/firestore';
import { appConfig } from '@/config/env';

export const firebaseApp = initializeApp(appConfig.firebase);

export const firebaseAuth = getAuth(firebaseApp);

export const firestoreDb = getFirestore(firebaseApp);
// simplifying setup to debug production issues
// export const firestoreDb = initializeFirestore(firebaseApp,
//   {
//     localCache:
//       persistentLocalCache(/*settings*/{ tabManager: persistentMultipleTabManager() })
//   });
