YchKhan commited on
Commit
4bf1cb4
·
verified ·
1 Parent(s): 280017c

remove multiple insight boxes

Browse files
Files changed (1) hide show
  1. templates/index.html +8 -7
templates/index.html CHANGED
@@ -293,15 +293,16 @@
293
  }
294
 
295
  const documentType = row.cells[0].textContent.toLowerCase();
296
-
297
- // Create or get the insight cells
298
- let insightsContainer;
299
- if (row.querySelector('.insights-container')) {
300
- insightsContainer = row.querySelector('.insights-container');
 
301
  insightsContainer.innerHTML = '<div class="loading-spinner"></div><div>Extracting insights...</div>';
302
  } else {
303
- // Create insights cell that spans across all columns
304
- const insightsRow = document.createElement('tr');
305
  insightsRow.className = 'insights-row';
306
 
307
  const insightsTd = document.createElement('td');
 
293
  }
294
 
295
  const documentType = row.cells[0].textContent.toLowerCase();
296
+ // Check if there's already an insights row for this document
297
+ let insightsRow = row.nextElementSibling;
298
+ if (insightsRow && insightsRow.className === 'insights-row') {
299
+ // Insights row already exists, get the container
300
+ insightsContainer = insightsRow.querySelector('.insights-container');
301
+
302
  insightsContainer.innerHTML = '<div class="loading-spinner"></div><div>Extracting insights...</div>';
303
  } else {
304
+ // Create insights row that spans across all columns
305
+ insightsRow = document.createElement('tr');
306
  insightsRow.className = 'insights-row';
307
 
308
  const insightsTd = document.createElement('td');