return;
}
- // Updated generateTitleString function
- const generateTitleString = (titleObj) => {
- if (!titleObj || typeof titleObj !== 'object') return '';
-
- const typeTitles = {
- offline: '📦 Оффлайн',
- online: '🌐 Онлайн',
- marketplace: '🛒 Маркетплейс'
- };
-
- const parts = Object.entries(titleObj)
- .map(([typeKey, typeValue]) => {
- if (!typeValue || typeof typeValue !== 'object') return '';
- const lines = Object.entries(typeValue)
- .map(([key, val]) => `- ${key.replace(/_/g, ' ')}: ${parseFloat(val).toFixed(2)}`);
- return `${typeTitles[typeKey] || typeKey}:\n${lines.join('\n')}`;
- })
- .filter(Boolean);
-
- return parts.join('\n\n');
- };
-
const fragment = document.createDocumentFragment();
response.forEach(item => {
return parts.join('\n\n');
}
-