diff options
| author | Jay V <[email protected]> | 2025-08-30 15:28:35 -0400 |
|---|---|---|
| committer | Jay V <[email protected]> | 2025-08-30 15:28:35 -0400 |
| commit | d3bbaa141ca74853d5f4c9f2a13575adedf824d8 (patch) | |
| tree | 083bde744bf5ea23f01f2d4b18c8bbffcd4e9358 /cloud/app/src/routes/workspace.tsx | |
| parent | 8714f235090ca7977662c36bdff2413bbe200943 (diff) | |
| download | opencode-d3bbaa141ca74853d5f4c9f2a13575adedf824d8.tar.gz opencode-d3bbaa141ca74853d5f4c9f2a13575adedf824d8.zip | |
ignore: cloud
Diffstat (limited to 'cloud/app/src/routes/workspace.tsx')
| -rw-r--r-- | cloud/app/src/routes/workspace.tsx | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/cloud/app/src/routes/workspace.tsx b/cloud/app/src/routes/workspace.tsx index 6876ae962..f75af8e74 100644 --- a/cloud/app/src/routes/workspace.tsx +++ b/cloud/app/src/routes/workspace.tsx @@ -1,7 +1,20 @@ import "./workspace.css" import { useAuthSession } from "~/context/auth.session" import { IconLogo } from "../component/icon" -import { action, redirect, RouteSectionProps } from "@solidjs/router" +import { withActor } from "~/context/auth.withActor" +import "./workspace.css" +import { query, action, redirect, createAsync, RouteSectionProps } from "@solidjs/router" +import { User } from "@opencode/cloud-core/user.js" +import { Actor } from "@opencode/cloud-core/actor.js" + +const getUserInfo = query(async () => { + "use server" + return withActor(async () => { + const actor = Actor.assert("user") + const user = await User.fromID(actor.properties.userID) + return { user } + }) +}, "userInfo") const logout = action(async () => { "use server" @@ -17,6 +30,7 @@ const logout = action(async () => { }) export default function WorkspaceLayout(props: RouteSectionProps) { + const userInfo = createAsync(() => getUserInfo()) return ( <main data-page="workspace"> <header data-component="workspace-header"> @@ -26,7 +40,9 @@ export default function WorkspaceLayout(props: RouteSectionProps) { </a> </div> <div data-slot="header-actions"> - <span>[email protected]</span> + {userInfo() && + <span>{userInfo()!.user.email}</span> + } <form action={logout} method="post"> <button type="submit" formaction={logout}>Logout</button> </form> |
