Skip to main content

Type Alias: GetTabFinishes()

GetTabFinishes = (finishes) => Promise<OptionSetData[]>

Function

Retrieves detailed information about material finish options displayed in a tab.

This method fetches comprehensive data about material options (finishes, fabrics, colors, etc.) that are presented in a product tab. For each finish, it retrieves the complete option set data including available options, images, descriptions, and any additional metadata.

The returned data is enhanced with proper image URLs and formatted descriptions, making it ready for immediate display in the user interface.

Parameters

finishes

TabMaterial[]

Array of material definitions from the product tab

Returns

Promise<OptionSetData[]>

A promise resolving to an array of fully populated option set data objects

Example

// Get detailed data for all wood finishes in a tab
const finishesTab = productTabs.find(tab => tab.tabType === 'FINISHES');
const finishesData = await window.mimeeqApp.actions.getTabFinishes(finishesTab.materials);

// Display each finish option set with its available options
finishesData.forEach(finishSet => {
const container = document.createElement('div');
container.innerHTML = `<h3>${finishSet.display}</h3>`;

// Add each individual finish option with its image
finishSet.options.forEach(option => {
const optionEl = document.createElement('div');
optionEl.innerHTML = `
<img src="${option.thumbnail}" alt="${option.name}">
<span>${option.name}</span>
`;
container.appendChild(optionEl);
});

document.getElementById('finishes-container').appendChild(container);
});