Setting page content based on current repeater item

Hello, I’m trying to make a page for a client with a repeater full of items and when they click an item it expands a column with several elements on it whose content I want to have match the current, clicked item in the repeater. I’m not a very experienced coder and tried to use the following to make it work but can’t seem to.

$w.onReady( function () {
$w( ‘#repeater1’ ).forEachItem(($w, itemData, index) => {
$w( ‘#image1’ ).onClick( () => {
$w( ‘#column1’ ).expand()
$w( ‘#dataset1’ ).getCurrentItem()
.then( ( ) => {
$w( “#image2” ).src === itemData.cover;
$w( “#text1” ).text === itemData.title;
$w( “#text2” ).text === itemData.description;
$w( “#text3” ).text === itemData.author;
$w( “#text4” ).text === itemData.word;
});
});
});
});

so you would click an image on the left and it would become the source for the large image, and it’s associated fields in the Book Recs ($w(‘#dataset1’)) data set.