@jonsoc/console-app 1.1.34

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (217) hide show
  1. package/.opencode/agent/css.md +149 -0
  2. package/README.md +32 -0
  3. package/package.json +49 -0
  4. package/public/apple-touch-icon-v3.png +1 -0
  5. package/public/apple-touch-icon.png +1 -0
  6. package/public/email +1 -0
  7. package/public/favicon-96x96-v3.png +1 -0
  8. package/public/favicon-96x96.png +1 -0
  9. package/public/favicon-v3.ico +1 -0
  10. package/public/favicon-v3.svg +1 -0
  11. package/public/favicon.ico +1 -0
  12. package/public/favicon.svg +1 -0
  13. package/public/opencode-brand-assets.zip +0 -0
  14. package/public/robots.txt +6 -0
  15. package/public/site.webmanifest +1 -0
  16. package/public/social-share-black.png +1 -0
  17. package/public/social-share-zen.png +1 -0
  18. package/public/social-share.png +1 -0
  19. package/public/theme.json +182 -0
  20. package/public/web-app-manifest-192x192.png +1 -0
  21. package/public/web-app-manifest-512x512.png +1 -0
  22. package/script/generate-sitemap.ts +103 -0
  23. package/src/app.css +1 -0
  24. package/src/app.tsx +27 -0
  25. package/src/asset/black/hero.png +0 -0
  26. package/src/asset/brand/opencode-brand-assets.zip +0 -0
  27. package/src/asset/brand/opencode-logo-dark.png +0 -0
  28. package/src/asset/brand/opencode-logo-dark.svg +16 -0
  29. package/src/asset/brand/opencode-logo-light.png +0 -0
  30. package/src/asset/brand/opencode-logo-light.svg +16 -0
  31. package/src/asset/brand/opencode-wordmark-dark.png +0 -0
  32. package/src/asset/brand/opencode-wordmark-dark.svg +30 -0
  33. package/src/asset/brand/opencode-wordmark-light.png +0 -0
  34. package/src/asset/brand/opencode-wordmark-light.svg +30 -0
  35. package/src/asset/brand/opencode-wordmark-simple-dark.png +0 -0
  36. package/src/asset/brand/opencode-wordmark-simple-dark.svg +22 -0
  37. package/src/asset/brand/opencode-wordmark-simple-light.png +0 -0
  38. package/src/asset/brand/opencode-wordmark-simple-light.svg +22 -0
  39. package/src/asset/brand/preview-opencode-dark.png +0 -0
  40. package/src/asset/brand/preview-opencode-logo-dark.png +0 -0
  41. package/src/asset/brand/preview-opencode-logo-light.png +0 -0
  42. package/src/asset/brand/preview-opencode-wordmark-dark.png +0 -0
  43. package/src/asset/brand/preview-opencode-wordmark-light.png +0 -0
  44. package/src/asset/brand/preview-opencode-wordmark-simple-dark.png +0 -0
  45. package/src/asset/brand/preview-opencode-wordmark-simple-light.png +0 -0
  46. package/src/asset/lander/avatar-adam.png +0 -0
  47. package/src/asset/lander/avatar-david.png +0 -0
  48. package/src/asset/lander/avatar-dax.png +0 -0
  49. package/src/asset/lander/avatar-frank.png +0 -0
  50. package/src/asset/lander/avatar-jay.png +0 -0
  51. package/src/asset/lander/brand-assets-dark.svg +10 -0
  52. package/src/asset/lander/brand-assets-light.svg +10 -0
  53. package/src/asset/lander/brand.png +0 -0
  54. package/src/asset/lander/check.svg +3 -0
  55. package/src/asset/lander/copy.svg +3 -0
  56. package/src/asset/lander/desktop-app-icon.png +0 -0
  57. package/src/asset/lander/dock.png +0 -0
  58. package/src/asset/lander/logo-dark.svg +11 -0
  59. package/src/asset/lander/logo-light.svg +11 -0
  60. package/src/asset/lander/opencode-comparison-min.mp4 +0 -0
  61. package/src/asset/lander/opencode-comparison-poster.png +0 -0
  62. package/src/asset/lander/opencode-desktop-icon.png +0 -0
  63. package/src/asset/lander/opencode-logo-dark.svg +11 -0
  64. package/src/asset/lander/opencode-logo-light.svg +11 -0
  65. package/src/asset/lander/opencode-min.mp4 +0 -0
  66. package/src/asset/lander/opencode-poster.png +0 -0
  67. package/src/asset/lander/opencode-wordmark-dark.svg +25 -0
  68. package/src/asset/lander/opencode-wordmark-light.svg +25 -0
  69. package/src/asset/lander/screenshot-github.png +0 -0
  70. package/src/asset/lander/screenshot-splash.png +0 -0
  71. package/src/asset/lander/screenshot-vscode.png +0 -0
  72. package/src/asset/lander/screenshot.png +0 -0
  73. package/src/asset/lander/wordmark-dark.svg +3 -0
  74. package/src/asset/lander/wordmark-light.svg +3 -0
  75. package/src/asset/logo-ornate-dark.svg +18 -0
  76. package/src/asset/logo-ornate-light.svg +18 -0
  77. package/src/asset/logo.svg +18 -0
  78. package/src/asset/zen-ornate-dark.svg +8 -0
  79. package/src/asset/zen-ornate-light.svg +8 -0
  80. package/src/component/dropdown.css +80 -0
  81. package/src/component/dropdown.tsx +79 -0
  82. package/src/component/email-signup.tsx +48 -0
  83. package/src/component/faq.tsx +33 -0
  84. package/src/component/footer.tsx +38 -0
  85. package/src/component/header-context-menu.css +63 -0
  86. package/src/component/header.tsx +279 -0
  87. package/src/component/icon.tsx +257 -0
  88. package/src/component/legal.tsx +20 -0
  89. package/src/component/modal.css +66 -0
  90. package/src/component/modal.tsx +24 -0
  91. package/src/component/spotlight.css +15 -0
  92. package/src/component/spotlight.tsx +820 -0
  93. package/src/config.ts +29 -0
  94. package/src/context/auth.session.ts +0 -0
  95. package/src/context/auth.ts +116 -0
  96. package/src/context/auth.withActor.ts +7 -0
  97. package/src/entry-client.tsx +4 -0
  98. package/src/entry-server.tsx +30 -0
  99. package/src/global.d.ts +5 -0
  100. package/src/lib/github.ts +38 -0
  101. package/src/middleware.ts +5 -0
  102. package/src/routes/[...404].css +130 -0
  103. package/src/routes/[...404].tsx +38 -0
  104. package/src/routes/api/enterprise.ts +47 -0
  105. package/src/routes/auth/[...callback].ts +41 -0
  106. package/src/routes/auth/authorize.ts +10 -0
  107. package/src/routes/auth/index.ts +12 -0
  108. package/src/routes/auth/logout.ts +17 -0
  109. package/src/routes/auth/status.ts +7 -0
  110. package/src/routes/bench/[id].tsx +365 -0
  111. package/src/routes/bench/index.tsx +86 -0
  112. package/src/routes/bench/submission.ts +29 -0
  113. package/src/routes/black/common.tsx +62 -0
  114. package/src/routes/black/index.tsx +108 -0
  115. package/src/routes/black/subscribe/[plan].tsx +449 -0
  116. package/src/routes/black/workspace.css +214 -0
  117. package/src/routes/black/workspace.tsx +229 -0
  118. package/src/routes/black.css +828 -0
  119. package/src/routes/black.tsx +285 -0
  120. package/src/routes/brand/index.css +555 -0
  121. package/src/routes/brand/index.tsx +252 -0
  122. package/src/routes/changelog/index.css +477 -0
  123. package/src/routes/changelog/index.tsx +147 -0
  124. package/src/routes/debug/index.ts +13 -0
  125. package/src/routes/desktop-feedback.ts +5 -0
  126. package/src/routes/discord.ts +5 -0
  127. package/src/routes/docs/[...path].ts +20 -0
  128. package/src/routes/docs/index.ts +20 -0
  129. package/src/routes/download/[platform].ts +38 -0
  130. package/src/routes/download/index.css +750 -0
  131. package/src/routes/download/index.tsx +482 -0
  132. package/src/routes/download/types.ts +4 -0
  133. package/src/routes/enterprise/index.css +578 -0
  134. package/src/routes/enterprise/index.tsx +251 -0
  135. package/src/routes/index.css +1251 -0
  136. package/src/routes/index.tsx +840 -0
  137. package/src/routes/legal/privacy-policy/index.css +343 -0
  138. package/src/routes/legal/privacy-policy/index.tsx +1512 -0
  139. package/src/routes/legal/terms-of-service/index.css +254 -0
  140. package/src/routes/legal/terms-of-service/index.tsx +512 -0
  141. package/src/routes/openapi.json.ts +7 -0
  142. package/src/routes/s/[id].ts +20 -0
  143. package/src/routes/stripe/webhook.ts +532 -0
  144. package/src/routes/t/[...path].tsx +20 -0
  145. package/src/routes/temp.tsx +172 -0
  146. package/src/routes/user-menu.css +18 -0
  147. package/src/routes/user-menu.tsx +32 -0
  148. package/src/routes/workspace/[id]/billing/billing-section.module.css +185 -0
  149. package/src/routes/workspace/[id]/billing/billing-section.tsx +240 -0
  150. package/src/routes/workspace/[id]/billing/black-section.module.css +142 -0
  151. package/src/routes/workspace/[id]/billing/black-section.tsx +269 -0
  152. package/src/routes/workspace/[id]/billing/black-waitlist-section.module.css +23 -0
  153. package/src/routes/workspace/[id]/billing/index.tsx +32 -0
  154. package/src/routes/workspace/[id]/billing/monthly-limit-section.module.css +96 -0
  155. package/src/routes/workspace/[id]/billing/monthly-limit-section.tsx +133 -0
  156. package/src/routes/workspace/[id]/billing/payment-section.module.css +93 -0
  157. package/src/routes/workspace/[id]/billing/payment-section.tsx +122 -0
  158. package/src/routes/workspace/[id]/billing/reload-section.module.css +261 -0
  159. package/src/routes/workspace/[id]/billing/reload-section.tsx +213 -0
  160. package/src/routes/workspace/[id]/graph-section.module.css +145 -0
  161. package/src/routes/workspace/[id]/graph-section.tsx +475 -0
  162. package/src/routes/workspace/[id]/index.tsx +81 -0
  163. package/src/routes/workspace/[id]/keys/index.tsx +11 -0
  164. package/src/routes/workspace/[id]/keys/key-section.module.css +197 -0
  165. package/src/routes/workspace/[id]/keys/key-section.tsx +176 -0
  166. package/src/routes/workspace/[id]/members/index.tsx +11 -0
  167. package/src/routes/workspace/[id]/members/member-section.module.css +249 -0
  168. package/src/routes/workspace/[id]/members/member-section.tsx +343 -0
  169. package/src/routes/workspace/[id]/members/role-dropdown.css +72 -0
  170. package/src/routes/workspace/[id]/members/role-dropdown.tsx +43 -0
  171. package/src/routes/workspace/[id]/model-section.module.css +173 -0
  172. package/src/routes/workspace/[id]/model-section.tsx +174 -0
  173. package/src/routes/workspace/[id]/new-user-section.module.css +143 -0
  174. package/src/routes/workspace/[id]/new-user-section.tsx +104 -0
  175. package/src/routes/workspace/[id]/provider-section.module.css +138 -0
  176. package/src/routes/workspace/[id]/provider-section.tsx +188 -0
  177. package/src/routes/workspace/[id]/settings/index.tsx +11 -0
  178. package/src/routes/workspace/[id]/settings/settings-section.module.css +94 -0
  179. package/src/routes/workspace/[id]/settings/settings-section.tsx +122 -0
  180. package/src/routes/workspace/[id]/usage-section.module.css +185 -0
  181. package/src/routes/workspace/[id]/usage-section.tsx +200 -0
  182. package/src/routes/workspace/[id].css +308 -0
  183. package/src/routes/workspace/[id].tsx +62 -0
  184. package/src/routes/workspace/common.tsx +120 -0
  185. package/src/routes/workspace-picker.css +74 -0
  186. package/src/routes/workspace-picker.tsx +122 -0
  187. package/src/routes/workspace.css +107 -0
  188. package/src/routes/workspace.tsx +38 -0
  189. package/src/routes/zen/index.css +866 -0
  190. package/src/routes/zen/index.tsx +343 -0
  191. package/src/routes/zen/util/dataDumper.ts +44 -0
  192. package/src/routes/zen/util/error.ts +13 -0
  193. package/src/routes/zen/util/handler.ts +784 -0
  194. package/src/routes/zen/util/logger.ts +12 -0
  195. package/src/routes/zen/util/provider/anthropic.ts +752 -0
  196. package/src/routes/zen/util/provider/google.ts +75 -0
  197. package/src/routes/zen/util/provider/openai-compatible.ts +546 -0
  198. package/src/routes/zen/util/provider/openai.ts +630 -0
  199. package/src/routes/zen/util/provider/provider.ts +210 -0
  200. package/src/routes/zen/util/rateLimiter.ts +41 -0
  201. package/src/routes/zen/util/stickyProviderTracker.ts +16 -0
  202. package/src/routes/zen/util/trialLimiter.ts +49 -0
  203. package/src/routes/zen/v1/chat/completions.ts +11 -0
  204. package/src/routes/zen/v1/messages.ts +11 -0
  205. package/src/routes/zen/v1/models/[model].ts +13 -0
  206. package/src/routes/zen/v1/models.ts +60 -0
  207. package/src/routes/zen/v1/responses.ts +11 -0
  208. package/src/style/base.css +21 -0
  209. package/src/style/component/button.css +102 -0
  210. package/src/style/index.css +8 -0
  211. package/src/style/reset.css +76 -0
  212. package/src/style/token/color.css +91 -0
  213. package/src/style/token/font.css +21 -0
  214. package/src/style/token/space.css +46 -0
  215. package/sst-env.d.ts +9 -0
  216. package/tsconfig.json +21 -0
  217. package/vite.config.ts +25 -0
@@ -0,0 +1,74 @@
1
+ [data-component="workspace-picker"] {
2
+ [data-component="dropdown"] {
3
+ [data-slot="trigger"] {
4
+ /* Override blue accent colors with neutral colors for dropdown trigger */
5
+ --color-accent: var(--color-border);
6
+ --color-accent-hover: var(--color-border);
7
+ --color-accent-active: var(--color-border);
8
+ --color-primary: var(--color-border);
9
+ --color-primary-hover: var(--color-border);
10
+ --color-primary-active: var(--color-border);
11
+ --color-primary-alpha-20: transparent;
12
+ }
13
+
14
+ [data-slot="dropdown"] {
15
+ max-height: 240px;
16
+ overflow-y: auto;
17
+ min-width: 200px;
18
+ }
19
+ }
20
+
21
+ [data-slot="create-item"] {
22
+ width: 100%;
23
+ padding: var(--space-2-5) var(--space-3);
24
+ border: none;
25
+ background: none;
26
+ color: var(--color-text);
27
+ font-size: var(--font-size-sm);
28
+ font-family: var(--font-sans);
29
+ text-align: left;
30
+ cursor: pointer;
31
+ transition: background-color 0.15s ease;
32
+
33
+ &:hover {
34
+ background-color: var(--color-bg-surface);
35
+ }
36
+ }
37
+
38
+ [data-slot="create-form"] {
39
+ width: 100%;
40
+ }
41
+
42
+ [data-slot="create-input-group"] {
43
+ display: flex;
44
+ flex-direction: column;
45
+ gap: var(--space-3);
46
+ }
47
+
48
+ [data-slot="button-group"] {
49
+ display: flex;
50
+ gap: var(--space-2);
51
+ justify-content: flex-end;
52
+ }
53
+
54
+ [data-slot="create-input"] {
55
+ flex: 1;
56
+ padding: var(--space-2-5) var(--space-3);
57
+ border: 1px solid var(--color-border);
58
+ border-radius: var(--border-radius-sm);
59
+ background-color: var(--color-bg);
60
+ color: var(--color-text);
61
+ font-size: var(--font-size-sm);
62
+ font-family: var(--font-sans);
63
+
64
+ &:focus {
65
+ outline: none;
66
+ border-color: var(--color-border);
67
+ box-shadow: none;
68
+ }
69
+
70
+ &::placeholder {
71
+ color: var(--color-text-muted);
72
+ }
73
+ }
74
+ }
@@ -0,0 +1,122 @@
1
+ import { query, useParams, action, createAsync, redirect, useSubmission } from "@solidjs/router"
2
+ import { For, Show, createEffect } from "solid-js"
3
+ import { createStore } from "solid-js/store"
4
+ import { withActor } from "~/context/auth.withActor"
5
+ import { Actor } from "@jonsoc/console-core/actor.js"
6
+ import { and, Database, eq, isNull } from "@jonsoc/console-core/drizzle/index.js"
7
+ import { WorkspaceTable } from "@jonsoc/console-core/schema/workspace.sql.js"
8
+ import { UserTable } from "@jonsoc/console-core/schema/user.sql.js"
9
+ import { Workspace } from "@jonsoc/console-core/workspace.js"
10
+ import { Dropdown, DropdownItem } from "~/component/dropdown"
11
+ import { Modal } from "~/component/modal"
12
+ import "./workspace-picker.css"
13
+
14
+ const getWorkspaces = query(async () => {
15
+ "use server"
16
+ return withActor(async () => {
17
+ return Database.use((tx) =>
18
+ tx
19
+ .select({
20
+ id: WorkspaceTable.id,
21
+ name: WorkspaceTable.name,
22
+ slug: WorkspaceTable.slug,
23
+ })
24
+ .from(UserTable)
25
+ .innerJoin(WorkspaceTable, eq(UserTable.workspaceID, WorkspaceTable.id))
26
+ .where(
27
+ and(
28
+ eq(UserTable.accountID, Actor.account()),
29
+ isNull(WorkspaceTable.timeDeleted),
30
+ isNull(UserTable.timeDeleted),
31
+ ),
32
+ ),
33
+ )
34
+ })
35
+ }, "workspaces")
36
+
37
+ const createWorkspace = action(async (form: FormData) => {
38
+ "use server"
39
+ const name = form.get("workspaceName") as string
40
+ if (name?.trim()) {
41
+ return withActor(async () => {
42
+ const workspaceID = await Workspace.create({ name: name.trim() })
43
+ return redirect(`/workspace/${workspaceID}`)
44
+ })
45
+ }
46
+ }, "createWorkspace")
47
+
48
+ export function WorkspacePicker() {
49
+ const params = useParams()
50
+ const workspaces = createAsync(() => getWorkspaces())
51
+ const submission = useSubmission(createWorkspace)
52
+ const [store, setStore] = createStore({
53
+ showForm: false,
54
+ })
55
+ let inputRef: HTMLInputElement | undefined
56
+
57
+ const currentWorkspace = () => {
58
+ const ws = workspaces()?.find((w) => w.id === params.id)
59
+ return ws ? ws.name : "Select workspace"
60
+ }
61
+
62
+ const handleWorkspaceNew = () => {
63
+ setStore("showForm", true)
64
+ }
65
+
66
+ createEffect(() => {
67
+ if (store.showForm && inputRef) {
68
+ setTimeout(() => inputRef?.focus(), 0)
69
+ }
70
+ })
71
+
72
+ const handleSelectWorkspace = (workspaceID: string) => {
73
+ if (workspaceID === params.id) return
74
+ window.location.href = `/workspace/${workspaceID}`
75
+ }
76
+
77
+ // Reset signals when workspace ID changes
78
+ createEffect(() => {
79
+ params.id
80
+ setStore("showForm", false)
81
+ })
82
+
83
+ return (
84
+ <div data-component="workspace-picker">
85
+ <Dropdown trigger={currentWorkspace()} align="left">
86
+ <For each={workspaces()}>
87
+ {(workspace) => (
88
+ <DropdownItem selected={workspace.id === params.id} onClick={() => handleSelectWorkspace(workspace.id)}>
89
+ {workspace.name || workspace.slug}
90
+ </DropdownItem>
91
+ )}
92
+ </For>
93
+ <button data-slot="create-item" type="button" onClick={() => handleWorkspaceNew()}>
94
+ + Create New Workspace
95
+ </button>
96
+ </Dropdown>
97
+
98
+ <Modal open={store.showForm} onClose={() => setStore("showForm", false)} title="Create New Workspace">
99
+ <form data-slot="create-form" action={createWorkspace} method="post">
100
+ <div data-slot="create-input-group">
101
+ <input
102
+ ref={inputRef}
103
+ data-slot="create-input"
104
+ type="text"
105
+ name="workspaceName"
106
+ placeholder="Enter workspace name"
107
+ required
108
+ />
109
+ <div data-slot="button-group">
110
+ <button type="button" data-color="ghost" onClick={() => setStore("showForm", false)}>
111
+ Cancel
112
+ </button>
113
+ <button type="submit" data-color="primary" disabled={submission.pending}>
114
+ {submission.pending ? "Creating..." : "Create"}
115
+ </button>
116
+ </div>
117
+ </div>
118
+ </form>
119
+ </Modal>
120
+ </div>
121
+ )
122
+ }
@@ -0,0 +1,107 @@
1
+ [data-page="workspace"] {
2
+ line-height: 1;
3
+
4
+ /* Common elements */
5
+ button {
6
+ padding: var(--space-3) var(--space-4);
7
+ border: 1px solid var(--color-border);
8
+ border-radius: var(--border-radius-sm);
9
+ background-color: var(--color-bg);
10
+ color: var(--color-text);
11
+ font-size: var(--font-size-sm);
12
+ font-family: var(--font-sans);
13
+ font-weight: 500;
14
+ cursor: pointer;
15
+ transition: all 0.15s ease;
16
+
17
+ &:hover:not(:disabled) {
18
+ background-color: var(--color-surface-hover);
19
+ border-color: var(--color-accent);
20
+ }
21
+
22
+ &:active {
23
+ transform: translateY(1px);
24
+ }
25
+
26
+ &:disabled {
27
+ opacity: 0.5;
28
+ transform: none;
29
+ }
30
+
31
+ &[data-color="primary"] {
32
+ background-color: var(--color-primary);
33
+ border-color: var(--color-primary);
34
+ color: var(--color-primary-text);
35
+
36
+ &:hover:not(:disabled) {
37
+ background-color: var(--color-primary-hover);
38
+ border-color: var(--color-primary-hover);
39
+ }
40
+ }
41
+
42
+ &[data-color="ghost"] {
43
+ background-color: transparent;
44
+ border-color: transparent;
45
+ color: var(--color-text-muted);
46
+
47
+ &:hover:not(:disabled) {
48
+ background-color: var(--color-surface-hover);
49
+ border-color: var(--color-border);
50
+ color: var(--color-text);
51
+ }
52
+ }
53
+ }
54
+
55
+ a {
56
+ color: var(--color-text);
57
+ }
58
+
59
+ /* Workspace Header */
60
+ [data-component="workspace-header"] {
61
+ position: sticky;
62
+ top: 0;
63
+ z-index: 100;
64
+ display: flex;
65
+ justify-content: space-between;
66
+ align-items: center;
67
+ padding: var(--space-4) var(--space-4);
68
+ border-bottom: 1px solid var(--color-border);
69
+ background-color: var(--color-bg);
70
+
71
+ @media (max-width: 30rem) {
72
+ padding: var(--space-4) var(--space-4);
73
+ }
74
+ }
75
+
76
+ [data-slot="header-brand"] {
77
+ flex: 0 0 auto;
78
+ padding-top: 4px;
79
+ display: flex;
80
+ align-items: center;
81
+ gap: var(--space-4);
82
+
83
+ [data-component="site-title"] {
84
+ font-size: var(--font-size-lg);
85
+ font-weight: 600;
86
+ color: var(--color-text);
87
+ letter-spacing: -0.02em;
88
+ }
89
+ }
90
+
91
+ [data-slot="header-actions"] {
92
+ display: flex;
93
+ gap: var(--space-4);
94
+ align-items: center;
95
+ font-size: var(--font-size-sm);
96
+
97
+ [data-slot="user"] {
98
+ color: var(--color-text-muted);
99
+ }
100
+
101
+ @media (max-width: 30rem) {
102
+ [data-slot="user"] {
103
+ display: none;
104
+ }
105
+ }
106
+ }
107
+ }
@@ -0,0 +1,38 @@
1
+ import { query, createAsync, RouteSectionProps, useParams, A } from "@solidjs/router"
2
+ import "./workspace.css"
3
+ import { IconWorkspaceLogo } from "../component/icon"
4
+ import { WorkspacePicker } from "./workspace-picker"
5
+ import { UserMenu } from "./user-menu"
6
+ import { withActor } from "~/context/auth.withActor"
7
+ import { User } from "@jonsoc/console-core/user.js"
8
+ import { Actor } from "@jonsoc/console-core/actor.js"
9
+
10
+ const getUserEmail = query(async (workspaceID: string) => {
11
+ "use server"
12
+ return withActor(async () => {
13
+ const actor = Actor.assert("user")
14
+ const email = await User.getAuthEmail(actor.properties.userID)
15
+ return email
16
+ }, workspaceID)
17
+ }, "userEmail")
18
+
19
+ export default function WorkspaceLayout(props: RouteSectionProps) {
20
+ const params = useParams()
21
+ const userEmail = createAsync(() => getUserEmail(params.id!))
22
+ return (
23
+ <main data-page="workspace">
24
+ <header data-component="workspace-header">
25
+ <div data-slot="header-brand">
26
+ <A href="/" data-component="site-title">
27
+ <IconWorkspaceLogo />
28
+ </A>
29
+ <WorkspacePicker />
30
+ </div>
31
+ <div data-slot="header-actions">
32
+ <UserMenu email={userEmail()} />
33
+ </div>
34
+ </header>
35
+ <div>{props.children}</div>
36
+ </main>
37
+ )
38
+ }