Skip to content

Commit 6707fb5

Browse files
Make workouts clickable on dashboard page
- Add Link components to workout cards - Navigate to /dashboard/workout/[workoutId] when clicked - Preserve existing styling and hover effects Closes #9 Co-authored-by: Tom Phillips <tomphill@users.noreply.github.com>
1 parent 7ee6242 commit 6707fb5

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/app/dashboard/page.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { format } from "date-fns";
33
import { CalendarClient } from "./calendar-client";
44
import { Button } from "@/components/ui/button";
55
import { Suspense } from "react";
6+
import Link from "next/link";
67

78
interface DashboardPageProps {
89
searchParams: Promise<{ date?: string }>;
@@ -45,9 +46,10 @@ async function DashboardContent({ searchParams }: { searchParams: { date?: strin
4546
<div className="space-y-4">
4647
{workouts.length > 0 ? (
4748
workouts.map((workout) => (
48-
<div
49+
<Link
4950
key={workout.id}
50-
className="border rounded-lg p-4 hover:shadow-md transition-shadow"
51+
href={`/dashboard/workout/${workout.id}`}
52+
className="block border rounded-lg p-4 hover:shadow-md transition-shadow"
5153
>
5254
<div className="flex justify-between items-start mb-2">
5355
<h3 className="font-semibold text-lg">{workout.name}</h3>
@@ -70,7 +72,7 @@ async function DashboardContent({ searchParams }: { searchParams: { date?: strin
7072
)}
7173
</div>
7274
</div>
73-
</div>
75+
</Link>
7476
))
7577
) : (
7678
<div className="border rounded-lg p-8 text-center">

0 commit comments

Comments
 (0)