login button not responding

Someone please help with this piece of code, I don’t understand whats wrong;

import wixUsers from ‘wix-users’;
import wixData from ‘wix-data’;
import wixLocation from ‘wix-location’;

$w.onReady( () => {
if(wixUsers.currentUser.loggedIn) {
$w(“#button2”).label = “Verlaten”;
$w(“#button3”).show();
}
else {
$w(“#button2”).label = “Login/Registreer”;
$w(“#button3”).hide();
}
} );

export function button3_onclick() {
wixLocation.to(/Quser_data/${wixUsers.currentUser.id});
// user is logged in
if(wixUsers.currentUser.loggedIn) {
// log the user out
wixUsers.logout()
.then( () => {
// update buttons accordingly
$w(“#button2”).label = “Login/Registreer”;
$w(“#button3”).hide();
} );
}
// user is logged out
else {
let userId;
let userEmail;

// prompt the user to log in  
wixUsers.promptLogin( {"mode": "Login/Registreer"} ) 
  .then( (user) => { 
    userId = user.id; 
    return user.getEmail(); 
  } ) 
  .then( (email) => { 
    // check if there is an item for the user in the collection 
    userEmail = email; 
    return wixData.query("Quser_data") 
      .eq("_id", userId) 
      .find(); 
  } ) 
  .then( (results) => { 
    // if an item for the user is not found 
    if (results.items.length === 0) { 
      // create an item 
      const toInsert = { 
        "_id": userId, 
        "email": userEmail 
      }; 
      // add the item to the collection 
      wixData.insert("Quser_data", toInsert) 
        .catch( (err) => { 
          console.log(err); 
        } ); 
    } 
    // update buttons accordingly 
    $w("#button2").label = "Verlaten"; 
    $w("#button3").show(); 
  } ) 
  .catch( (err) => { 
    console.log(err); 
  } ); 

}
}

export function button3_onclick() {
wixLocation.to(/Quser_data/${wixUsers.currentUser.id});
}

Hi,
You have mixed up a lot of code line…
I suggest watching this great tutorial by Nayeli about how to build a member profile page.

Liran.