Create tab-style content box with items from content manager?

Could you add something like this to the code? I don’t think this is fully correct for velo but something similar might work.

$w.onReady(function () {
// get the data from your collection
let collectionData = [];

wixData.query(“MyCollection”)
.find()
.then((results) => {
collectionData = results.items;
generateTabs(collectionData);
});

// function to generate the HTML for your tabs
function generateTabs(data) {
// get the tab container element
let tabContainer = $w(“#myTabContainer”);

// clear any existing tabs 
tabContainer.removeAll(); 

// loop through the data and create a new tab for each item 
data.forEach((item) => { 
  // create a new tab element 
  let newTab = $w("<tab></tab>"); 

  // set the tab label and content based on the data 
  newTab.label = item.tabName; 
  newTab.content = item.tabContent; 

  // add the new tab to the container 
  tabContainer.add(newTab); 
}); 

}
});