// firebase.js // firebase is initialised here
import { initializeApp } from 'firebase/app';
import { getMessaging } from 'firebase/messaging';

const firebaseConfig = {
  // apiKey: process.env.REACT_APP_FIREBASE_API_KEY,
  // authDomain: process.env.REACT_APP_FIREBASE_AUTH_DOMAIN,
  // databaseURL: process.env.REACT_APP_FIREBASE_DATABASE_URL,
  // projectId: process.env.REACT_APP_FIREBASE_PROJECT_ID,
  // storageBucket: process.env.REACT_APP_FIREBASE_STORAGE_BUCKET,
  // messagingSenderId: process.env.REACT_APP_FIREBASE_MESSAGING_SENDER_ID,
  // appId: process.env.REACT_APP_FIREBASE_APP_ID,
  // measurementId: process.env.REACT_APP_FIREBASE_MEASUREMENT_ID
  apiKey: 'AIzaSyACBg8oyAR2DWMu4xW85gx5thpRgxnvI_0',
  authDomain: 'nearle-gear.firebaseapp.com',
  databaseURL: 'https://nearle-gear-default-rtdb.firebaseio.com',
  projectId: 'nearle-gear',
  storageBucket: 'nearle-gear.appspot.com',
  messagingSenderId: '140444764229',
  appId: '1:140444764229:web:e5ed6259a92d0532283b2c',
  measurementId: 'G-3YQ4DNMXE5'
};

// Initialize Firebase only once
const app = initializeApp(firebaseConfig);

// Export initialized messaging instance
export const messaging = getMessaging(app);
