- To get started, edit the page.tsx file. -
-- Looking for a starting point or more instructions? Head over to{" "} - - Templates - {" "} - or the{" "} - - Learning - {" "} - center. -
-diff --git a/app/page.tsx b/app/page.tsx index 3f36f7c..6761c5c 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -1,65 +1,62 @@ -import Image from "next/image"; +// Next.js Server Component (no 'use client' needed here) +// This page runs on the server, reads from SQLite directly, and renders HTML + +import { getTasks } from '@/src/lib/tasks'; +import TaskForm from '@/src/lib/components/TaskForm'; +import TaskCard from '@/src/lib/components/TaskCard'; +import TaskFilterToolbar from '@/src/lib/components/TaskFilterToolbar'; + +// Next.js 15 page props for async searchParams +interface PageProps { + searchParams: Promise<{ sortBy?: 'due_date' | 'topic' | 'status' }>; +} + +export default async function HomePage({ searchParams }: PageProps) { + // Await search parameters from the URL (e.g., ?sortBy=topic) + const params = await searchParams; + const sortBy = params.sortBy || 'due_date'; + + // Direct SQLite query on the server to get active tasks sorted + const tasks = getTasks(sortBy); -export default function Home() { return ( -
- Looking for a starting point or more instructions? Head over to{" "} - - Templates - {" "} - or the{" "} - - Learning - {" "} - center. -
-+ Local-first SQLite task manager with dynamic overdue detection. +
+No active tasks found. Create one above!
+{task.description}
+ )} + + {/* Footer section: Topic tag, Due Date, and Dynamic OVERDUE badge */} +