Skip to content

Commit 7470000

Browse files
committed
fix: Types
1 parent bcc1cb6 commit 7470000

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

app/pages/_pivot.tsx

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,14 @@ const intDatasource = {
4040
sourceUrl: "https://int.lindas.admin.ch/query",
4141
sourceType: "sparql",
4242
};
43-
const datasets = mapValues(
43+
44+
type Dataset = {
45+
label: string;
46+
iri: string;
47+
datasource: typeof intDatasource;
48+
};
49+
50+
const datasets: Record<string, Dataset> = mapValues(
4451
{
4552
"https://environment.ld.admin.ch/foen/fab_Offentliche_Ausgaben_test3/8": {
4653
label: "ausgaben",
@@ -150,7 +157,7 @@ const Bar = ({ percent }: { percent: number }) => {
150157
);
151158
};
152159

153-
const PivotTable = ({ dataset }: { dataset: typeof datasets[number] }) => {
160+
const PivotTable = ({ dataset }: { dataset: typeof datasets[string] }) => {
154161
const [activeMeasures, setActiveMeasures] = useState<
155162
Record<Measure["iri"], boolean>
156163
>({});
@@ -342,7 +349,7 @@ const PivotTable = ({ dataset }: { dataset: typeof datasets[number] }) => {
342349
const showBars = m.label.includes("%");
343350
return {
344351
Header: m.label,
345-
Cell: ({ cell, row }) => {
352+
Cell: ({ cell }) => {
346353
return (
347354
<>
348355
{cell.value}

0 commit comments

Comments
 (0)