feat: show active timer on dashboard homepage with clock-out button

Adds a banner below the page header when a timer is running: shows
description, client, elapsed time (live), a Stop button that auto-links
to the latest invoice, and a Details link to the time clock page.
Query is prefetched server-side so the widget is instant on load.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-06 18:05:54 -04:00
co-authored by Claude Sonnet 4.6
parent 540150be33
commit ef94b69e52
2 changed files with 115 additions and 0 deletions
+6
View File
@@ -492,6 +492,7 @@ function CardSkeleton() {
}
import { DashboardPageHeader } from "~/components/layout/page-header";
import { ActiveTimerWidget } from "~/app/dashboard/_components/active-timer-widget";
// ... imports
@@ -503,6 +504,7 @@ export default async function DashboardPage() {
// Fetch stats centrally
const stats = await api.dashboard.getStats();
void api.timeEntries.getRunning.prefetch();
return (
<div className="page-enter space-y-6">
@@ -511,6 +513,10 @@ export default async function DashboardPage() {
description="Here's what's happening with your business today"
/>
<HydrateClient>
<ActiveTimerWidget />
</HydrateClient>
<HydrateClient>
<Suspense fallback={<StatsSkeleton />}>
<DashboardStats stats={stats} />