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) => )}
)