Update homepage to use filters.

This commit is contained in:
Drew 2025-09-23 17:31:48 -07:00
parent 6e85edbf05
commit 90d18311fb
8 changed files with 552 additions and 21 deletions

View file

@ -5,7 +5,7 @@ import type { Task } from '~/types/task'
export function meta(_: Route.MetaArgs) {
return [
{ title: "Captain's Log - Tasks" },
{ title: "Captain's Log - Dashboard" },
{ name: 'description', content: 'Task Dashboard' },
]
}
@ -14,7 +14,7 @@ export async function loader(): Promise<{ tasks: Task[] }> {
try {
// Fetch tasks from the backend API during SSR
const apiUrl = process.env.API_URL || 'http://localhost:3000'
const response = await fetch(`${apiUrl}/api/tasks`, {
const response = await fetch(`${apiUrl}/api/tasks?status=todo`, {
headers: {
'Content-Type': 'application/json',
},
@ -38,7 +38,7 @@ export default function Home({ loaderData }: Route.ComponentProps) {
<Container maxWidth="lg">
<Box sx={{ py: 4 }}>
<Typography variant="h1" component="h1" gutterBottom>
Tasks
Dashboard
</Typography>
<TaskList initialTasks={loaderData.tasks} />
</Box>