+ {zone.rows.map((row) => {
+ const isSpanning = zone.cells.some(
+ (c) => c.row_index === row.index && c.col_type === 'spanning_header',
+ )
+
+ // Row height from measured px
+ const measuredH = (row.y_max_px ?? 0) - (row.y_min_px ?? 0)
+ const rowH = Math.max(fontSize * 1.4, measuredH * scale)
+
+ return (
+
+ {isSpanning ? (
+ // Render spanning cells
+ zone.cells
+ .filter((c) => c.row_index === row.index && c.col_type === 'spanning_header')
+ .sort((a, b) => a.col_index - b.col_index)
+ .map((cell) => {
+ const colspan = (cell as any).colspan || numCols
+ const gridColStart = cell.col_index + 1
+ const gridColEnd = gridColStart + colspan
+ const color = getCellColor(cell)
+ return (
+
+ {cell.text}
+
+ )
+ })
+ ) : (
+ // Render normal columns
+ zone.columns.map((col) => {
+ const cell = cellMap.get(`${row.index}_${col.index}`)
+ if (!cell) {
+ return
+ }
+ const color = getCellColor(cell)
+ const isBold = col.bold || cell.is_bold || row.is_header
+ const text = cell.text ?? ''
+ const isMultiLine = text.includes('\n')
+
+ return (
+
+ {text}
+
+ )
+ })
+ )}
+
+ )
+ })}
+