merge
This commit is contained in:
@@ -21,7 +21,15 @@ function ObjectUser({user}:Props){
|
||||
const [open, setOpen] = useState<boolean>(false);
|
||||
const [open2, setOpen2] = useState<boolean>(false);
|
||||
const [loading,setLoading] = useState<boolean>(false);
|
||||
const [sessions,setSessions] = useState<Session[]>([]);
|
||||
|
||||
// Initialisation sécurisée des sessions
|
||||
function getInitialSessions(): Session[] {
|
||||
if (user instanceof Athlete || user instanceof Coach) return [...(user.sessions || [])];
|
||||
return [];
|
||||
}
|
||||
|
||||
const [sessions, setSessions] = useState<Session[]>(getInitialSessions());
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -87,7 +95,7 @@ function ObjectUser({user}:Props){
|
||||
return(
|
||||
<div>
|
||||
<div className="object" onClick={() => handleOpen()}>
|
||||
<div>{user.nom}</div>
|
||||
<div>{user.prenom} {user.nom}</div>
|
||||
|
||||
{/* <div>{user2.role}</div> */}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user