diff --git a/.phase5-state.json b/.phase5-state.json index 0bb1f23..93c434d 100644 --- a/.phase5-state.json +++ b/.phase5-state.json @@ -1,7 +1,8 @@ { "completed_features": [ - "dark-mode-toggle" + "dark-mode-toggle", + "customer-detail-page" ], - "current_feature": "customer-detail-page", + "current_feature": "project-detail-page", "started_at": "2026-05-23T05:20:11.407108" } \ No newline at end of file diff --git a/GENERATION_LOG.md b/GENERATION_LOG.md index 871efa1..f000128 100644 --- a/GENERATION_LOG.md +++ b/GENERATION_LOG.md @@ -561,3 +561,13 @@ undefined - `05:22:17` **INFO** wrote 5138 chars in 39.8s (attempt 1) - `05:22:17` **INFO** Running tsc --noEmit on api… - `05:22:18` **INFO** tsc clean ✓ +- `05:22:18` **INFO** Committed feature customer-detail-page +- `05:22:19` **INFO** Pushed: rc=0 + +## Phase-3 Feature: project-detail-page (2026-05-23 05:22:19) + +- `05:22:19` **INFO** Description: Project-Detail: zeigt Customer + alle TimeEntries des Projekts +- `05:22:19` **INFO** Generating apps/web/src/pages/ProjectDetail.tsx (ProjectDetail-Page. Header: name + linked customer. Section: TimeEntri…) +- `05:22:50` **INFO** wrote 3762 chars in 31.4s (attempt 1) +- `05:22:50` **INFO** Running tsc --noEmit on api… +- `05:22:52` **INFO** tsc clean ✓ diff --git a/apps/web/src/pages/ProjectDetail.tsx b/apps/web/src/pages/ProjectDetail.tsx new file mode 100644 index 0000000..c38565e --- /dev/null +++ b/apps/web/src/pages/ProjectDetail.tsx @@ -0,0 +1,88 @@ +import { useQuery } from "@tanstack/react-query" +import { useParams, Link } from "@tanstack/react-router" +import { api } from "../lib/api" + +export default function ProjectDetail() { + const { projectId } = useParams({ strict: false }) + + const { data: project, isLoading: projectLoading, isError: projectError } = useQuery({ + queryKey: ["project", projectId], + queryFn: () => api.getProject(projectId!), + enabled: !!projectId, + }) + + const { data: entries, isLoading: entriesLoading } = useQuery({ + queryKey: ["timeEntries", projectId], + queryFn: () => api.listTimeEntries({ projectId: projectId! }), + enabled: !!projectId, + }) + + if (projectLoading || entriesLoading) { + return
Loading project details...
+ } + + if (projectError || !project) { + return
Project not found or error loading data.
+ } + + const totalHours = entries?.reduce((sum: number, entry: any) => sum + (entry.hours || 0), 0) || 0 + + return ( +
+
+
+ + ← Back to Projects + +

{project.name}

+

+ Customer: {project.customer?.name || "Unknown"} +

+
+
+ Total Hours + {totalHours.toFixed(2)}h +
+
+ +
+
+

Time Entries

+
+ +
+ + + + + + + + + + {entries && entries.length > 0 ? ( + entries.map((entry: any) => ( + + + + + + )) + ) : ( + + + + )} + +
DateDescriptionHours
+ {new Date(entry.date).toLocaleDateString()} + {entry.description} + {entry.hours}h +
+ No time entries recorded for this project yet. +
+
+
+
+ ) +} \ No newline at end of file