Skip to content

Commit d87da9d

Browse files
author
Dylan Huang
committed
refactor Dashboard component to simplify dataset summary display by replacing table with div elements
1 parent 81fc0fc commit d87da9d

1 file changed

Lines changed: 4 additions & 30 deletions

File tree

vite-app/src/components/Dashboard.tsx

Lines changed: 4 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -53,36 +53,10 @@ const Dashboard = observer(({ onRefresh }: DashboardProps) => {
5353
<h2 className="text-sm font-semibold text-gray-900 mb-2">
5454
Dataset Summary
5555
</h2>
56-
<table className="w-full text-xs">
57-
<tbody>
58-
<tr>
59-
<td className="pr-4">
60-
<span className="font-semibold text-gray-700">Total Rows:</span>{" "}
61-
{state.dataset.length}
62-
</td>
63-
<td className="pr-4">
64-
<span className="font-semibold text-gray-700">Avg Score:</span>{" "}
65-
{state.dataset.length > 0
66-
? (
67-
state.dataset.reduce(
68-
(sum, row) => sum + (row.evaluation_result?.score || 0),
69-
0
70-
) / state.dataset.length
71-
).toFixed(3)
72-
: "N/A"}
73-
</td>
74-
<td>
75-
<span className="font-semibold text-gray-700">
76-
Total Messages:
77-
</span>{" "}
78-
{state.dataset.reduce(
79-
(sum, row) => sum + row.messages.length,
80-
0
81-
)}
82-
</td>
83-
</tr>
84-
</tbody>
85-
</table>
56+
<div className="text-xs">
57+
<span className="font-semibold text-gray-700">Total Rows:</span>{" "}
58+
{state.dataset.length}
59+
</div>
8660
</div>
8761

8862
{/* Show empty state or main table */}

0 commit comments

Comments
 (0)