From a35c7824c94f6383a214ddcbe39995fbbcedf0fd Mon Sep 17 00:00:00 2001 From: Bhanu Prakash Sai Potteri Date: Sat, 23 May 2026 11:21:56 +0530 Subject: [PATCH] Render charts in separate row below tiles --- src/components/RecordViewTable.tsx | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/src/components/RecordViewTable.tsx b/src/components/RecordViewTable.tsx index bd1f196..9e2efcb 100644 --- a/src/components/RecordViewTable.tsx +++ b/src/components/RecordViewTable.tsx @@ -268,17 +268,27 @@ export default function RecordViewTable({ viewId, onRowClick, toolbarAction }: P onRowClick ? onRowClick(id) : navigate(`/detail/${id}`); }; + const tileSpecs = analyticsSpecs.filter(a => a.kind === "tile"); + const chartSpecs = analyticsSpecs.filter(a => a.kind === "chart"); const analyticsRow = analyticsSpecs.length > 0 ? ( -
- {analyticsSpecs.map((a, i) => { - if (a.kind === "tile") { - const tv = tileValues.find(t => t.tile_uid === a.uid); - return ; - } - const cd = chartData.find(c => c.chart_uid === a.uid); - const Chart = a.chartType === "pie" ? PieChart : BarChart; - return ; - })} +
+ {tileSpecs.length > 0 && ( +
+ {tileSpecs.map((a, i) => { + const tv = tileValues.find(t => t.tile_uid === a.uid); + return ; + })} +
+ )} + {chartSpecs.length > 0 && ( +
+ {chartSpecs.map((a, i) => { + const cd = chartData.find(c => c.chart_uid === a.uid); + const Chart = (a as { chartType?: string }).chartType === "pie" ? PieChart : BarChart; + return ; + })} +
+ )}
) : null;