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:
@@ -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} />
|
||||
|
||||
Reference in New Issue
Block a user