Add monthly statistics dashboard

This commit is contained in:
2026-08-05 14:25:08 +02:00
parent cfc4ef45a8
commit eafd718e64
5 changed files with 1091 additions and 0 deletions
+8
View File
@@ -2,6 +2,7 @@ import {
BarChart3,
CheckCircle2,
Command,
ChartNoAxesCombined,
LayoutGrid,
LogOut,
Moon,
@@ -57,6 +58,7 @@ import { AnalysisPage } from "./views/AnalysisPage";
import { LoginPage } from "./views/LoginPage";
import { ProfilePage } from "./views/ProfilePage";
import { RecurringBillingsPage } from "./views/RecurringBillingsPage";
import { StatisticsPage } from "./views/StatisticsPage";
import { TicketDetailPage } from "./views/TicketDetailPage";
import { TimerPage } from "./views/TimerPage";
import type { AuthUser, PeriodType } from "./types";
@@ -89,6 +91,10 @@ function routeFromPath(pathname: string) {
return { page: "analysis" as const };
}
if (pathname.startsWith("/statistics")) {
return { page: "statistics" as const };
}
if (pathname.startsWith("/recurring")) {
return { page: "recurring" as const };
}
@@ -501,6 +507,7 @@ export function App() {
const navItems = [
{ href: "/timer", label: "Timer", icon: Timer, active: path.startsWith("/timer") || path === "/" },
{ href: "/analysis", label: "Auswertung", icon: BarChart3, active: path.startsWith("/analysis") },
{ href: "/statistics", label: "Statistiken", icon: ChartNoAxesCombined, active: path.startsWith("/statistics") },
{ href: "/recurring", label: "Fixe Abrechnung", icon: Repeat, active: path.startsWith("/recurring") },
{ href: "/profile", label: "Profil", icon: UserCog, active: path.startsWith("/profile") },
...(currentUser.role === "admin"
@@ -685,6 +692,7 @@ export function App() {
/>
) : null}
{route.page === "analysis" ? <AnalysisPage onNavigate={navigate} /> : null}
{route.page === "statistics" ? <StatisticsPage onNavigate={navigate} /> : null}
{route.page === "recurring" ? <RecurringBillingsPage /> : null}
{route.page === "profile" ? <ProfilePage currentUser={currentUser} onUserUpdated={setCurrentUser} /> : null}
{route.page === "admin-users" && currentUser.role === "admin" ? <AdminUsersPage currentUser={currentUser} /> : null}