Add monthly statistics dashboard
This commit is contained in:
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user