From 6bff215d4f3ae8fd42322c2492771f0708739d75 Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Sat, 6 Jan 2024 23:53:44 -0600 Subject: [PATCH] WIP --- components/TodoList.tsx | 13 +++++++++++++ routes/index.tsx | 20 +++++--------------- 2 files changed, 18 insertions(+), 15 deletions(-) create mode 100644 components/TodoList.tsx diff --git a/components/TodoList.tsx b/components/TodoList.tsx new file mode 100644 index 0000000..37d548b --- /dev/null +++ b/components/TodoList.tsx @@ -0,0 +1,13 @@ +import { Todo, User } from '$models' + +export interface Props { + user: User +} + +export function TodoList({ user }: Props) { + return ( +
+

Todo List for {user}

+
+ ) +} diff --git a/routes/index.tsx b/routes/index.tsx index c53f48a..83fce82 100644 --- a/routes/index.tsx +++ b/routes/index.tsx @@ -1,7 +1,7 @@ import { Handlers, PageProps } from '$fresh/server.ts' import { useSignal } from '@preact/signals' -import Counter from '../islands/Counter.tsx' import { db, Todo, User } from '$models' +import { TodoList } from '../components/TodoList.tsx' interface Data { users: User[] @@ -18,24 +18,14 @@ export const handler: Handlers = { }, } -export default function Home(props: PageProps) { +export default function Home( + { data: { users, unassignedTodos } }: PageProps, +) { const count = useSignal(3) return (
- the Fresh logo: a sliced lemon dripping with juice -

Welcome to Fresh

-

- Try updating this message in the - ./routes/index.tsx file, and refresh. -

- + {users.map((u) => )}
)