Skip to content
Snippets Groups Projects
Commit 0a7f1b77 authored by David Bühler's avatar David Bühler
Browse files

[ivette] Pivot table: uses a global state for the pivot table.

Keeps the state of the pivot table when changing view.
parent 779c765e
Branches
Tags
No related merge requests found
......@@ -32,6 +32,7 @@ import { LED } from 'dome/controls/displays';
import { Scroll } from 'dome/layout/boxes';
import * as Status from 'frama-c/kernel/Status';
import * as States from 'frama-c/states';
import { GlobalState, useGlobalState } from 'dome/data/states';
import * as PivotState from 'frama-c/plugins/pivot/api/general';
import PivotTableUI from 'react-pivottable/PivotTableUI';
import 'frama-c/kernel/PivotTable-style.css';
......@@ -44,8 +45,10 @@ interface PivotTableProps {
data: string[][];
}
const PivotGlobalState = new GlobalState({});
export function Pivot(props: PivotTableProps): JSX.Element {
const [state, setState] = React.useState({});
const [state, setState] = useGlobalState(PivotGlobalState);
return (
<PivotTableUI
data={props.data}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment