Voglio passare i props al componente SingleChat, voglio passare id, image e name : import React, { useEffect, useState } from "react";
import axios from "axios";
import { useLocation } from "react-router-dom";
import styles from "../styles/Home.module.css";
import SingleChat from "../components/SingleChat";

function Home() {
  const location = useLocation();
  const currentID = location.state.userId;
  const [profiles, setProfiles] = useState([]);
  // const [selectedProfile, setSelectedProfile] = useState(null);

  useEffect(() => {
    async function fetchProfiles() {
      try {
        const response = await axios.get(
          `https://chatapp-2211c-default-rtdb.firebaseio.com/users.json`
        );
        const data = response.data;
        // Converto gli oggetti del database in un array di profili
        const profilesArray = Object.keys(data).map((key) => {
          return {
            id: key,
            ...data[key],
          };
        });
        const filteredProfiles = profilesArray.filter(
          (profile) => profile.id !== currentID
        );
        setProfiles(filteredProfiles);
        // console.log(filteredProfiles);
      } catch (error) {
        alert(error);
        // Gestisci l'errore
      }
    }

    fetchProfiles();
  }, [currentID]);

  // Funzione per selezionare il profilo
  // const selectProfile = (profile) => {
  //   setSelectedProfile(profile);
  // };

  return (
    <div className={styles.principalContainer}>
      <div className={styles.leftContainer}>
    