diff --git a/src/components/Dashboard.tsx b/src/components/Dashboard.tsx index db81d78..b311b0c 100644 --- a/src/components/Dashboard.tsx +++ b/src/components/Dashboard.tsx @@ -1,6 +1,6 @@ import React, { useState, useMemo, useEffect } from 'react'; import { useSearchParams } from 'react-router-dom'; -import { Line, Doughnut, Bar } from 'react-chartjs-2'; +import { Line, Bar } from 'react-chartjs-2'; import { Carousel, EmptyState, FilterControls, MultiSelect, StatCard } from './shared'; import { ExportableChart } from './ChartExport'; import { chartColors, createBaseOptions } from '../config/chartConfig'; @@ -95,9 +95,8 @@ function Dashboard({ data, showDataLabels, setShowDataLabels, includeVAT, setInc // Chart carousel labels const chartLabels = useMemo(() => { - const labels = [t('charts.revenueTrend'), t('charts.visitors'), t('charts.revenue'), t('charts.quarterly'), t('charts.channel'), t('charts.district'), t('charts.captureRate')]; - return filters.museum.length === 0 ? labels : labels.filter((_, i) => i !== 1 && i !== 2); - }, [filters.museum, t]); + return [t('charts.revenueTrend'), t('charts.visitors'), t('charts.revenue'), t('charts.quarterly'), t('charts.channel'), t('charts.district'), t('charts.captureRate')]; + }, [t]); // Dynamic lists from data const years = useMemo(() => getUniqueYears(data), [data]); @@ -547,21 +546,17 @@ function Dashboard({ data, showDataLabels, setShowDataLabels, includeVAT, setInc - {filters.museum.length === 0 && ( -
- - - -
- )} +
+ + + +
- {filters.museum.length === 0 && ( -
- - - -
- )} +
+ + + +
@@ -645,27 +640,23 @@ function Dashboard({ data, showDataLabels, setShowDataLabels, includeVAT, setInc
- {filters.museum.length === 0 && ( -
-
-

{t('dashboard.visitorsByMuseum')}

-
- -
+
+
+

{t('dashboard.visitorsByMuseum')}

+
+
- )} +
- {filters.museum.length === 0 && ( -
-
-

{t('dashboard.revenueByMuseum')}

-
- -
+
+
+

{t('dashboard.revenueByMuseum')}

+
+
- )} +