import React, { useEffect, useState } from "react"; import Header from "./components/Header"; import NaviBar from "./components/NaviBar"; import { Card } from "react-bootstrap"; import "./components/cssfiles/profiles.css"; import "./components/cssfiles/footer.css"; import firebase from '../firebase'; import "bootstrap/dist/css/bootstrap.min.css"; import { useNavigate } from "react-router-dom"; function Profile() { const navigate = useNavigate(); const [data, setData] = useState([]); const [loading, setLoading] = useState(true); useEffect(() => { const fetchData = async () => { try { const snapshot = await firebase.firestore().collection("users").get(); const profiles = snapshot.docs.map(doc => doc.data()); setData(profiles); } catch (error) { console.error('Error fetching data:', error); } setLoading(false); }; fetchData(); }, []); if (loading) { return