Wix Invoice in a Repeater with View Button

(The following post is translated from the French language with Google Translate)
Hello, I created a page that displays Wix invoices in a repeater. I created a function that allows you to create an invoice viewing URL. The only problem is that when the button is not in the repeater it works, but when it is in a repeater it no longer works.
I would like that when you click on a button its displays the invoice corresponding to the ID of the same container. Here is the code below:
Thank you in advance for your answers.

import {myCreateInvoicePreviewUrlFunction} from 'backend/ok.jsw'
import wixLocation from 'wix-location';

export async function button83_click(event) {
    let Invoice = $w("#text3").text;
await myCreateInvoicePreviewUrlFunction(Invoice).then((url)=>{
wixLocation.to(url)
});  
}

You can do fix it with one line of code and one wrapper change:

import { myCreateInvoicePreviewUrlFunction } from 'backend/ok.jsw'
import wixLocation from 'wix-location'

export async function button83_click(event) {
  let $item = $w.at(event.context) //add this line of code to get the repeater context wrapper
  let Invoice = $item('#text3').text //change $w to $item to get the repeater context element
  await myCreateInvoicePreviewUrlFunction(Invoice).then((url) => {
    wixLocation.to(url)
  })
}

That works ! Thanks very much !