From 1451f45711d302397e039661dac361c039904474 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Reinhard=20X=2E=20F=C3=BCrst?= Date: Sun, 10 May 2026 14:55:27 +0200 Subject: [PATCH] add Statistik component and API route --- app/MainClient.tsx | 25 +++++- app/api/statistik/route.ts | 66 ++++++++++++++ components/Statistik.tsx | 171 +++++++++++++++++++++++++++++++++++++ 3 files changed, 258 insertions(+), 4 deletions(-) create mode 100644 app/api/statistik/route.ts create mode 100644 components/Statistik.tsx diff --git a/app/MainClient.tsx b/app/MainClient.tsx index 9d1b38c..764302c 100644 --- a/app/MainClient.tsx +++ b/app/MainClient.tsx @@ -5,6 +5,7 @@ import { KUPPELN } from '@/types/logbuch'; import type { Kuppel, LogbuchEintrag } from '@/types/logbuch'; import LogbuchForm from '@/components/LogbuchForm'; import LogbuchList from '@/components/LogbuchList'; +import Statistik from '@/components/Statistik'; import packageJson from '@/package.json'; interface Props { @@ -15,7 +16,7 @@ interface Props { export default function MainClient({ kuerzel, beoId, beoName }: Props) { const [activeKuppel, setActiveKuppel] = useState('West'); - const [activeTab, setActiveTab] = useState<'eingabe' | 'liste'>('eingabe'); + const [activeTab, setActiveTab] = useState<'eingabe' | 'liste' | 'statistik'>('eingabe'); const [refreshKey, setRefreshKey] = useState(0); const [editEntry, setEditEntry] = useState(null); @@ -80,9 +81,9 @@ export default function MainClient({ kuerzel, beoId, beoName }: Props) { ))} - {/* Eingabe/Liste-Tabs */} + {/* Eingabe/Liste/Statistik-Tabs */}
- {(['eingabe', 'liste'] as const).map((tab) => ( + {(['eingabe', 'liste', 'statistik'] as const).map((tab) => ( ))}
@@ -162,6 +163,22 @@ export default function MainClient({ kuerzel, beoId, beoName }: Props) { )} + {/* Statistik-Tab */} + {activeTab === 'statistik' && ( +
+
+ Statistik {activeKuppel}-Kuppel + +
+ +
+ )} +