ConusAI vendor v0.1.0-dev.20261027+9b1131fb
ci / gate (push) Waiting to run

This commit is contained in:
ConusAI vendor v0.1.0-dev.20261027+9b1131fb
2026-10-27 18:05:17 +00:00
commit 3102273ec7
538 changed files with 80203 additions and 0 deletions
+55
View File
@@ -0,0 +1,55 @@
// SPDX-License-Identifier: LicenseRef-ConusAI-Template-1.0
// The organization's workspaces and the projects of each (spec §3.1).
import { projectList, workspaceList } from "@conusai-kit/tenancy"
import type { ReactElement } from "react"
import { orFallback } from "../../src/server/guard"
import { pageContext } from "../../src/server/page"
import { PROJECT_ENTRIES, projectHref } from "../../src/ui/projects"
export const dynamic = "force-dynamic"
export default async function OrgHome({ params }: { params: Promise<{ org: string }> }): Promise<ReactElement> {
const { org } = await params
const { caller, i18n, path } = await pageContext()
const projects = await orFallback(path, async () => {
const { workspaces } = await caller.call(workspaceList, { org })
return Promise.all(
workspaces.map(async (workspace) => ({
workspace,
projects: (await caller.call(projectList, { org, workspace: workspace.slug })).projects,
})),
)
})
return (
<>
<h1>{i18n.message("app.workspaces")}</h1>
<p>
<a href={`/${org}/workspaces`}>{i18n.message("workspace.create")}</a>
</p>
{projects.length === 0 ? <p>{i18n.message("workspace.none")}</p> : null}
{projects.map(({ workspace, projects: inWorkspace }) => (
<section key={workspace.slug}>
<h2>
<a href={`/${org}/${workspace.slug}`}>{workspace.name}</a>
</h2>
<p>{i18n.message("workspace.projectCount", { count: inWorkspace.length })}</p>
<ul>
{inWorkspace.map((project) => (
<li key={project.slug}>
<a href={projectHref(org, workspace.slug, project.slug)}>{project.name}</a>:
{PROJECT_ENTRIES.map((entry) => (
<span key={entry.href}>
{" "}
<a href={projectHref(org, workspace.slug, project.slug, entry)}>{i18n.message(entry.label)}</a>
</span>
))}
</li>
))}
</ul>
</section>
))}
</>
)
}