33 lines
1.2 KiB
TypeScript
33 lines
1.2 KiB
TypeScript
// SPDX-License-Identifier: LicenseRef-ConusAI-Template-1.0
|
|
// Onboarding: the first organization, which creates its default workspace and project in one
|
|
// transaction (kit-tenancy's use case), with the signed-in user as its owner. Joining an existing
|
|
// organization is not done by name (spec §3.3): it is an invitation, which has its own page.
|
|
|
|
import { redirect } from "next/navigation"
|
|
import type { ReactElement } from "react"
|
|
import { signInHref } from "../../src/server/guard"
|
|
import { pageContext } from "../../src/server/page"
|
|
import { ProcedureForm } from "../../src/ui/procedure-form"
|
|
|
|
export const dynamic = "force-dynamic"
|
|
|
|
export default async function Onboarding(): Promise<ReactElement> {
|
|
const { i18n, signedIn, path } = await pageContext()
|
|
if (!signedIn) redirect(signInHref(path))
|
|
return (
|
|
<main>
|
|
<h1>{i18n.message("app.createOrganization")}</h1>
|
|
<ProcedureForm
|
|
procedure="tenancy.org.create"
|
|
submitLabel={i18n.message("app.create")}
|
|
failedTemplate={i18n.message("app.failed")}
|
|
after="/{slug}"
|
|
fields={[
|
|
{ name: "name", label: i18n.message("app.name"), required: true },
|
|
{ name: "slug", label: i18n.message("app.slug"), required: true },
|
|
]}
|
|
/>
|
|
</main>
|
|
)
|
|
}
|