|
1 | 1 | import { observer } from "mobx-react"; |
2 | | -import { useMemo, useState, useEffect } from "react"; |
| 2 | +import { useState, useEffect } from "react"; |
3 | 3 | import { useLocation, useNavigate } from "react-router-dom"; |
4 | 4 | import { state } from "../App"; |
5 | 5 | import Button from "./Button"; |
6 | 6 | import { EvaluationTable } from "./EvaluationTable"; |
7 | 7 | import PivotTab from "./PivotTab"; |
8 | 8 | import TabButton from "./TabButton"; |
9 | | -import flattenJson from "../util/flatten-json"; |
10 | 9 |
|
11 | 10 | interface DashboardProps { |
12 | 11 | onRefresh: () => void; |
@@ -68,11 +67,6 @@ const Dashboard = observer(({ onRefresh }: DashboardProps) => { |
68 | 67 | setActiveTab(deriveTabFromPath(location.pathname)); |
69 | 68 | }, [location.pathname]); |
70 | 69 |
|
71 | | - const flattened = useMemo(() => { |
72 | | - const flattenedDataset = state.sortedDataset.map((row) => flattenJson(row)); |
73 | | - return flattenedDataset; |
74 | | - }, [state.sortedDataset]); |
75 | | - |
76 | 70 | return ( |
77 | 71 | <div className="text-sm"> |
78 | 72 | {/* Summary */} |
@@ -132,7 +126,7 @@ const Dashboard = observer(({ onRefresh }: DashboardProps) => { |
132 | 126 | {activeTab === "table" ? ( |
133 | 127 | <EvaluationTable /> |
134 | 128 | ) : ( |
135 | | - <PivotTab data={flattened} /> |
| 129 | + <PivotTab data={state.flattenedDataset} /> |
136 | 130 | )} |
137 | 131 | </div> |
138 | 132 | </div> |
|
0 commit comments