Skip to content

Commit

Permalink
fix: clean code
Browse files Browse the repository at this point in the history
  • Loading branch information
ClementNumericite committed May 24, 2023
1 parent 7ec965d commit fdef5c9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
3 changes: 1 addition & 2 deletions webapp-next/components/charts/table/Table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import { useContext } from 'react';
type Props = {
id: string;
datasets: { hits: any[]; label?: string }[];
rowsLabel: string;
};

export const ChartTable = (props: Props) => {
Expand All @@ -27,7 +26,7 @@ export const ChartTable = (props: Props) => {
}

const { aggregations } = context;
const { datasets, rowsLabel, id } = props;
const { datasets, id } = props;

if (!datasets[0]) return <>...</>;

Expand Down
10 changes: 4 additions & 6 deletions webapp-next/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,15 +92,13 @@ export default function Home() {
const ChartDisplay = () => {
switch (view) {
case 'line':
return <ChartLine id="line-example" datasets={datasets} />;
return <ChartLine id="line-cm2d" datasets={datasets} />;
case 'table':
return (
<ChartTable id="table-example" rowsLabel="Sexe" datasets={datasets} />
);
return <ChartTable id="table-cm2d" datasets={datasets} />;
case 'histogram':
return <ChartHistogram id="histogram-example" datasets={datasets} />;
return <ChartHistogram id="histogram-cm2d" datasets={datasets} />;
case 'doughnut':
return <ChartDoughnut id="doughnut-example" datasets={datasets} />;
return <ChartDoughnut id="doughnut-cm2d" datasets={datasets} />;
default:
return <>Pas de dataviz configurée pour cette vue</>;
}
Expand Down

0 comments on commit fdef5c9

Please sign in to comment.