Skip to content
Snippets Groups Projects
Commit 755d95e1 authored by Andre Maroneze's avatar Andre Maroneze
Browse files

[ivette] fix types for stricter linting rules

parent 6d57019e
No related branches found
No related tags found
No related merge requests found
...@@ -40,7 +40,11 @@ import 'react-pivottable/pivottable.css'; ...@@ -40,7 +40,11 @@ import 'react-pivottable/pivottable.css';
// --- Pivot Table for Properties // --- Pivot Table for Properties
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
export function Pivot(props: any) { interface PivotTableProps {
data: string[][];
}
export function Pivot(props: PivotTableProps) : JSX.Element {
const [state, setState] = React.useState({}); const [state, setState] = React.useState({});
return ( return (
<PivotTableUI <PivotTableUI
...@@ -70,13 +74,13 @@ function PivotTableBuild () : JSX.Element { ...@@ -70,13 +74,13 @@ function PivotTableBuild () : JSX.Element {
const rawData = States.useSyncValue(PivotState.pivotState); const rawData = States.useSyncValue(PivotState.pivotState);
const [computing, setComputing] = React.useState(false); const [computing, setComputing] = React.useState(false);
const [error, setError] = React.useState(''); const [error, setError] = React.useState('');
async function handleError (err: string) { async function handleError (err: string) : Promise<void> {
const msg = const msg =
`The pivot table could not be built: an error has occured (${err}).`; `The pivot table could not be built: an error has occured (${err}).`;
setError(msg); setError(msg);
Status.setMessage({ text: msg, kind: 'error' }); Status.setMessage({ text: msg, kind: 'error' });
} }
async function compute () { async function compute () : Promise<void> {
setComputing(true); setComputing(true);
setError(''); setError('');
Server.send(PivotState.compute, []) Server.send(PivotState.compute, [])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment