diff --git a/web/src/pages/Index/index.tsx b/web/src/pages/Index/index.tsx index 2907398..93e53e1 100644 --- a/web/src/pages/Index/index.tsx +++ b/web/src/pages/Index/index.tsx @@ -1,14 +1,72 @@ -import { useAccountRepo } from "@/repository/account"; -import { useEffect, type FC } from "react"; +import { useDbContext } from "@/context/db/db"; +import { useAccountRepo, type LocalAccount } from "@/repository/account"; +import { useEffect, useState, type FC } from "react"; + +import overlay from "@/assets/overlay.jpg"; +import { Card, CardContent } from "@/components/ui/card"; +import { User } from "lucide-react"; const IndexPage: FC = () => { + const [accounts, setAccounts] = useState([]); + const repo = useAccountRepo(); + const { connected } = useDbContext(); useEffect(() => { - repo.loadAll().then((res) => console.log({ res })); - }, [repo]); + if (connected) repo.loadAll().then(setAccounts); + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [connected]); - return
; + return ( +
+
+ +
+
+ icon + +
+

+ Select Account +

+

+ Choose one of the accounts below in order to proceed to home + lab services and tools. +

+
+
+ + {/* */} + + {accounts.map((account) => ( +
+
+
+ +
+
+
+

{account.label}

+

{account.email}

+
+
+ ))} +
+
+
+
+
+ ); }; export default IndexPage;