@colveor/admin 0.0.0-stage → 0.5.2

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 (154) hide show
  1. package/LICENSE.md +106 -0
  2. package/TAILWINDADMIN-LICENSE +21 -0
  3. package/dist/account/data.d.ts +1 -0
  4. package/dist/account/data.js +44 -0
  5. package/dist/account/profile.d.ts +6 -0
  6. package/dist/account/profile.js +118 -0
  7. package/dist/account/sessions.d.ts +1 -0
  8. package/dist/account/sessions.js +26 -0
  9. package/dist/account/shared.d.ts +26 -0
  10. package/dist/account/shared.js +44 -0
  11. package/dist/account/two-factor.d.ts +5 -0
  12. package/dist/account/two-factor.js +60 -0
  13. package/dist/actions.d.ts +39 -0
  14. package/dist/actions.js +81 -0
  15. package/dist/api/audit.gen.d.ts +80 -0
  16. package/dist/api/audit.gen.js +43 -0
  17. package/dist/api/auth.gen.d.ts +537 -0
  18. package/dist/api/auth.gen.js +313 -0
  19. package/dist/api/errors.gen.d.ts +16 -0
  20. package/dist/api/errors.gen.js +2 -0
  21. package/dist/api/gormx.gen.d.ts +60 -0
  22. package/dist/api/gormx.gen.js +16 -0
  23. package/dist/api/health.gen.d.ts +103 -0
  24. package/dist/api/health.gen.js +23 -0
  25. package/dist/api/index.gen.d.ts +21 -0
  26. package/dist/api/index.gen.js +22 -0
  27. package/dist/api/invitations.gen.d.ts +128 -0
  28. package/dist/api/invitations.gen.js +57 -0
  29. package/dist/api/ledger.gen.d.ts +269 -0
  30. package/dist/api/ledger.gen.js +113 -0
  31. package/dist/api/msgtemplate.gen.d.ts +31 -0
  32. package/dist/api/msgtemplate.gen.js +2 -0
  33. package/dist/api/notifications.gen.d.ts +66 -0
  34. package/dist/api/notifications.gen.js +28 -0
  35. package/dist/api/outbox.gen.d.ts +8 -0
  36. package/dist/api/outbox.gen.js +2 -0
  37. package/dist/api/queue.gen.d.ts +112 -0
  38. package/dist/api/queue.gen.js +15 -0
  39. package/dist/api/rbac.gen.d.ts +406 -0
  40. package/dist/api/rbac.gen.js +191 -0
  41. package/dist/api/reauth.gen.d.ts +289 -0
  42. package/dist/api/reauth.gen.js +122 -0
  43. package/dist/api/recorded_payments.gen.d.ts +171 -0
  44. package/dist/api/recorded_payments.gen.js +79 -0
  45. package/dist/api/sessions.gen.d.ts +64 -0
  46. package/dist/api/sessions.gen.js +48 -0
  47. package/dist/api/settings.gen.d.ts +147 -0
  48. package/dist/api/settings.gen.js +69 -0
  49. package/dist/api/storage.gen.d.ts +327 -0
  50. package/dist/api/storage.gen.js +208 -0
  51. package/dist/api/support_access.gen.d.ts +155 -0
  52. package/dist/api/support_access.gen.js +131 -0
  53. package/dist/api/users.gen.d.ts +407 -0
  54. package/dist/api/users.gen.js +159 -0
  55. package/dist/api/verification.gen.d.ts +427 -0
  56. package/dist/api/verification.gen.js +280 -0
  57. package/dist/api/webhooks.gen.d.ts +110 -0
  58. package/dist/api/webhooks.gen.js +45 -0
  59. package/dist/auth-layout.d.ts +9 -0
  60. package/dist/auth-layout.js +5 -0
  61. package/dist/client.d.ts +41 -0
  62. package/dist/client.js +72 -0
  63. package/dist/config.d.ts +27 -0
  64. package/dist/config.js +82 -0
  65. package/dist/dates.d.ts +4 -0
  66. package/dist/dates.js +16 -0
  67. package/dist/header.d.ts +12 -0
  68. package/dist/header.js +105 -0
  69. package/dist/icons.d.ts +2 -0
  70. package/dist/icons.js +15 -0
  71. package/dist/index.d.ts +28 -0
  72. package/dist/index.js +42 -0
  73. package/dist/kit/avatar.d.ts +5 -0
  74. package/dist/kit/avatar.js +16 -0
  75. package/dist/kit/badge.d.ts +10 -0
  76. package/dist/kit/badge.js +31 -0
  77. package/dist/kit/card.d.ts +12 -0
  78. package/dist/kit/card.js +7 -0
  79. package/dist/kit/code-area.d.ts +15 -0
  80. package/dist/kit/code-area.js +69 -0
  81. package/dist/kit/dropdown.d.ts +26 -0
  82. package/dist/kit/dropdown.js +67 -0
  83. package/dist/kit/filter-tabs.d.ts +9 -0
  84. package/dist/kit/filter-tabs.js +7 -0
  85. package/dist/kit/modal.d.ts +8 -0
  86. package/dist/kit/modal.js +15 -0
  87. package/dist/kit/page-header.d.ts +13 -0
  88. package/dist/kit/page-header.js +13 -0
  89. package/dist/kit/search.d.ts +4 -0
  90. package/dist/kit/search.js +16 -0
  91. package/dist/kit/tooltip.d.ts +17 -0
  92. package/dist/kit/tooltip.js +52 -0
  93. package/dist/message-editor.d.ts +9 -0
  94. package/dist/message-editor.js +80 -0
  95. package/dist/money.d.ts +10 -0
  96. package/dist/money.js +17 -0
  97. package/dist/next.d.ts +6 -0
  98. package/dist/next.js +19 -0
  99. package/dist/pages/account.d.ts +1 -0
  100. package/dist/pages/account.js +47 -0
  101. package/dist/pages/audit.d.ts +1 -0
  102. package/dist/pages/audit.js +88 -0
  103. package/dist/pages/forgot-password.d.ts +1 -0
  104. package/dist/pages/forgot-password.js +73 -0
  105. package/dist/pages/ledger.d.ts +1 -0
  106. package/dist/pages/ledger.js +132 -0
  107. package/dist/pages/roles.d.ts +1 -0
  108. package/dist/pages/roles.js +102 -0
  109. package/dist/pages/settings.d.ts +1 -0
  110. package/dist/pages/settings.js +86 -0
  111. package/dist/pages/sign-in.d.ts +5 -0
  112. package/dist/pages/sign-in.js +117 -0
  113. package/dist/pages/status.d.ts +1 -0
  114. package/dist/pages/status.js +122 -0
  115. package/dist/pages/support.d.ts +1 -0
  116. package/dist/pages/support.js +90 -0
  117. package/dist/pages/teams.d.ts +1 -0
  118. package/dist/pages/teams.js +94 -0
  119. package/dist/pages/users.d.ts +1 -0
  120. package/dist/pages/users.js +158 -0
  121. package/dist/pages/webhooks.d.ts +1 -0
  122. package/dist/pages/webhooks.js +88 -0
  123. package/dist/permissions.d.ts +5 -0
  124. package/dist/permissions.js +31 -0
  125. package/dist/proof.d.ts +10 -0
  126. package/dist/proof.js +78 -0
  127. package/dist/proxy.d.ts +10 -0
  128. package/dist/proxy.js +166 -0
  129. package/dist/retry.d.ts +8 -0
  130. package/dist/retry.js +30 -0
  131. package/dist/router.d.ts +13 -0
  132. package/dist/router.js +14 -0
  133. package/dist/setting-fields.d.ts +12 -0
  134. package/dist/setting-fields.js +102 -0
  135. package/dist/setting-list.d.ts +22 -0
  136. package/dist/setting-list.js +78 -0
  137. package/dist/shell.d.ts +40 -0
  138. package/dist/shell.js +97 -0
  139. package/dist/support.d.ts +37 -0
  140. package/dist/support.js +76 -0
  141. package/dist/table.d.ts +40 -0
  142. package/dist/table.js +73 -0
  143. package/dist/ui.d.ts +39 -0
  144. package/dist/ui.js +56 -0
  145. package/dist/user-actions.d.ts +30 -0
  146. package/dist/user-actions.js +129 -0
  147. package/dist/user-roles.d.ts +4 -0
  148. package/dist/user-roles.js +51 -0
  149. package/dist/user-row-menu.d.ts +14 -0
  150. package/dist/user-row-menu.js +45 -0
  151. package/dist/version.d.ts +1 -0
  152. package/dist/version.js +3 -0
  153. package/package.json +59 -4
  154. package/README.md +0 -3
@@ -0,0 +1,102 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
+ // Roles and their permissions: list, create, edit, delete. The API keeps
4
+ // the rules (system roles stay, a role is managed only by a higher one, a
5
+ // permission is granted only by someone holding it) and the page shows its
6
+ // refusals. Every change asks for a reason (useAction).
7
+ import { useEffect, useState } from "react";
8
+ import { Cancelled, useAction } from "../actions";
9
+ import * as rbac from "../api/rbac.gen";
10
+ import { api } from "../client";
11
+ import { PageHeader } from "../kit/page-header";
12
+ import { PermissionPicker } from "../permissions";
13
+ import { useCan } from "../shell";
14
+ import { Alert } from "../ui";
15
+ const input = "w-full rounded-lg border border-gray-300 bg-transparent px-3 py-2 text-sm text-gray-800 focus:border-brand-300 focus:outline-none disabled:opacity-60 dark:border-gray-700 dark:text-white/90";
16
+ const primary = "rounded-lg bg-brand-500 px-4 py-2 text-sm font-medium text-white hover:bg-brand-600 disabled:opacity-40";
17
+ const secondary = "rounded-lg border border-gray-300 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50 disabled:opacity-40 dark:border-gray-700 dark:text-gray-300";
18
+ export default function RolesPage() {
19
+ const [roles, setRoles] = useState(null);
20
+ // The role open in the editor, or "new".
21
+ const [open, setOpen] = useState(null);
22
+ const [error, setError] = useState("");
23
+ const canManage = useCan(rbac.PermissionManage);
24
+ const load = () => api
25
+ .get("/v1/rbac/roles")
26
+ .then(setRoles)
27
+ .catch((err) => setError(err.message));
28
+ useEffect(() => {
29
+ load();
30
+ }, []);
31
+ const role = roles?.find((r) => r.id === open);
32
+ return (_jsxs("div", { className: "space-y-6", children: [_jsx(PageHeader, { title: "Roles", actions: canManage &&
33
+ open === null && (_jsx("button", { type: "button", className: primary, onClick: () => setOpen("new"), children: "New role" })) }), error !== "" && _jsx(Alert, { children: error }), open !== null ? (_jsx(RoleEditor, { role: open === "new" ? undefined : role, canManage: canManage, onDone: () => {
34
+ setOpen(null);
35
+ load();
36
+ } })) : (
37
+ // Small by design (the roles a project declares): not paged.
38
+ _jsx("div", { className: "overflow-hidden rounded-2xl border border-gray-200 bg-white dark:border-gray-800 dark:bg-white/[0.03]", children: _jsxs("table", { className: "min-w-full text-left text-sm", children: [_jsx("thead", { className: "border-b border-gray-100 text-gray-500 dark:border-gray-800 dark:text-gray-400", children: _jsxs("tr", { children: [_jsx("th", { className: "px-5 py-3 font-medium", children: "Role" }), _jsx("th", { className: "px-5 py-3 font-medium", children: "Level" }), _jsx("th", { className: "px-5 py-3 font-medium", children: "Permissions" })] }) }), _jsx("tbody", { className: "divide-y divide-gray-100 text-gray-800 dark:divide-gray-800 dark:text-white/90", children: [...(roles ?? [])]
39
+ .sort((a, b) => b.level - a.level)
40
+ .map((r) => (_jsxs("tr", { onClick: () => setOpen(r.id), className: "cursor-pointer hover:bg-gray-50 dark:hover:bg-white/5", children: [_jsxs("td", { className: "px-5 py-3", children: [_jsx("span", { className: "font-medium", children: r.name }), " ", _jsx("span", { className: "font-mono text-xs text-gray-500", children: r.slug }), r.system && _jsx(Badge, { children: "built in" }), r.default && _jsx(Badge, { children: "new users" })] }), _jsx("td", { className: "px-5 py-3", children: r.level }), _jsx("td", { className: "px-5 py-3 text-gray-500 dark:text-gray-400", children: r.grants_all ? "Every permission" : r.permissions.length })] }, r.id))) })] }) }))] }));
41
+ }
42
+ function RoleEditor(props) {
43
+ const { role, canManage } = props;
44
+ const [permissions, setPermissions] = useState(role?.permissions ?? []);
45
+ const [error, setError] = useState("");
46
+ const [busy, setBusy] = useState(false);
47
+ const { run, dialogs } = useAction();
48
+ const editable = canManage;
49
+ const attempt = async (fn) => {
50
+ setError("");
51
+ setBusy(true);
52
+ try {
53
+ await fn();
54
+ props.onDone();
55
+ }
56
+ catch (err) {
57
+ if (!(err instanceof Cancelled)) {
58
+ setError(err instanceof Error ? err.message : String(err));
59
+ }
60
+ }
61
+ finally {
62
+ setBusy(false);
63
+ }
64
+ };
65
+ const save = (event) => {
66
+ event.preventDefault();
67
+ const f = new FormData(event.currentTarget);
68
+ const fields = {
69
+ name: String(f.get("name")),
70
+ description: String(f.get("description")),
71
+ level: Number(f.get("level")),
72
+ };
73
+ attempt(async () => {
74
+ if (role === undefined) {
75
+ await run((o) => api.post("/v1/rbac/roles", { ...fields, slug: String(f.get("slug")), permissions }, o));
76
+ return;
77
+ }
78
+ // One run, so one reason for both. Sent again after a refusal,
79
+ // the first request sets the same values.
80
+ await run(async ({ reason, reauthToken }) => {
81
+ const o = { reason, reauthToken };
82
+ await api.patch(`/v1/rbac/roles/${role.id}`, { ...fields, default: f.get("default") === "on" }, o);
83
+ if (!role.grants_all && !sameSet(permissions, role.permissions)) {
84
+ await api.put(`/v1/rbac/roles/${role.id}/permissions`, { permissions }, o);
85
+ }
86
+ });
87
+ });
88
+ };
89
+ const remove = () => role !== undefined &&
90
+ window.confirm(`Delete the role ${role.name}? Users lose what it grants.`) &&
91
+ attempt(() => run((o) => api.delete(`/v1/rbac/roles/${role.id}`, o)));
92
+ return (_jsxs(_Fragment, { children: [_jsxs("form", { onSubmit: save, className: "space-y-6 rounded-2xl border border-gray-200 bg-white p-6 dark:border-gray-800 dark:bg-white/[0.03]", children: [error !== "" && _jsx(Alert, { children: error }), _jsxs("div", { className: "grid gap-4 md:grid-cols-2", children: [_jsx(Labelled, { label: "Name", htmlFor: "role-name", children: _jsx("input", { required: true, id: "role-name", name: "name", defaultValue: role?.name, disabled: !editable || role?.system, className: input }) }), _jsx(Labelled, { label: "Slug (fixed once created)", htmlFor: "role-slug", children: _jsx("input", { required: true, id: "role-slug", name: "slug", pattern: "[a-z][a-z0-9_]*", defaultValue: role?.slug, disabled: role !== undefined, className: `${input} font-mono` }) }), _jsx(Labelled, { label: "Description", htmlFor: "role-description", children: _jsx("input", { id: "role-description", name: "description", defaultValue: role?.description, disabled: !editable, className: input }) }), _jsx(Labelled, { label: "Level (manages the roles below it)", htmlFor: "role-level", children: _jsx("input", { required: true, id: "role-level", name: "level", type: "number", min: 0, defaultValue: role?.level ?? 10, disabled: !editable, className: input }) })] }), role !== undefined && (_jsxs("label", { className: "flex items-center gap-2 text-sm text-gray-700 dark:text-gray-300", children: [_jsx("input", { type: "checkbox", name: "default", defaultChecked: role.default, disabled: !editable, className: "size-4 rounded border-gray-300 text-brand-500" }), "Given to new users"] })), _jsxs("div", { children: [_jsx("h2", { className: "mb-3 font-medium text-gray-800 dark:text-white/90", children: "Permissions" }), role?.grants_all ? (_jsx("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: "This role holds every permission, including those added later." })) : (_jsx(PermissionPicker, { value: permissions, onChange: setPermissions, disabled: !editable }))] }), _jsxs("div", { className: "flex flex-wrap gap-3", children: [editable && (_jsx("button", { type: "submit", disabled: busy, className: primary, children: role === undefined ? "Create role" : "Save" })), _jsx("button", { type: "button", className: secondary, onClick: props.onDone, children: "Back" }), editable && role !== undefined && !role.system && (_jsx("button", { type: "button", disabled: busy, onClick: remove, className: "ml-auto rounded-lg px-4 py-2 text-sm text-red-600 hover:bg-red-50 disabled:opacity-40", children: "Delete role" }))] })] }), dialogs] }));
93
+ }
94
+ function sameSet(a, b) {
95
+ return a.length === b.length && a.every((x) => b.includes(x));
96
+ }
97
+ function Labelled(props) {
98
+ return (_jsxs("div", { children: [_jsx("label", { htmlFor: props.htmlFor, className: "mb-1.5 block text-sm font-medium text-gray-700 dark:text-gray-400", children: props.label }), props.children] }));
99
+ }
100
+ function Badge({ children }) {
101
+ return (_jsx("span", { className: "ml-2 rounded-full bg-gray-100 px-2 py-0.5 text-xs text-gray-600 dark:bg-white/5 dark:text-gray-400", children: children }));
102
+ }
@@ -0,0 +1 @@
1
+ export default function SettingsPage(): import("react").JSX.Element;
@@ -0,0 +1,86 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ // The settings page: the groups on the left (one per module, with the
4
+ // title and description its manifest gives), and the open group's settings
5
+ // on the right, each with a form for its type. A change asks for a reason, and a secret one for re-authentication
6
+ // (useAction does both when the API asks). The sms and mail groups can
7
+ // send a test. The project's app/(admin)/(colveor)/settings/page.tsx
8
+ // re-exports it.
9
+ import { useEffect, useMemo, useState } from "react";
10
+ import * as settings from "../api/settings.gen";
11
+ import { api } from "../client";
12
+ import { Card } from "../kit/card";
13
+ import { PageHeader } from "../kit/page-header";
14
+ import { InfoTip } from "../kit/tooltip";
15
+ import { input, SendTest, SettingRow } from "../setting-fields";
16
+ import { useCan } from "../shell";
17
+ import { Alert } from "../ui";
18
+ export default function SettingsPage() {
19
+ const [all, setAll] = useState(null);
20
+ const [groups, setGroups] = useState([]);
21
+ // The group shown on the right: its name ("auth").
22
+ const [open, setOpen] = useState("");
23
+ const [error, setError] = useState("");
24
+ const [filter, setFilter] = useState("");
25
+ const canManage = useCan(settings.PermissionSettingManage);
26
+ useEffect(() => {
27
+ // Small by design (one row per declared setting, one group per
28
+ // module): not paged.
29
+ Promise.all([
30
+ api.get("/v1/settings"),
31
+ api.get("/v1/settings/groups"),
32
+ ])
33
+ .then(([list, g]) => {
34
+ setAll(list);
35
+ setGroups(g);
36
+ setOpen((o) => o || (g[0]?.name ?? ""));
37
+ })
38
+ .catch((err) => setError(err.message));
39
+ }, []);
40
+ // The settings the search matches, by group name.
41
+ const matches = useMemo(() => {
42
+ const out = new Map();
43
+ const f = filter.trim().toLowerCase();
44
+ for (const s of all ?? []) {
45
+ // The key as shown ("test phones") as well as written ("test_phones").
46
+ const key = s.key.toLowerCase();
47
+ if (f === "" ||
48
+ key.includes(f) ||
49
+ key.replaceAll("_", " ").includes(f) ||
50
+ s.description.toLowerCase().includes(f)) {
51
+ const name = groupOf(s);
52
+ out.set(name, [...(out.get(name) ?? []), s]);
53
+ }
54
+ }
55
+ return out;
56
+ }, [all, filter]);
57
+ // A search that leaves the open group empty opens the first that matches.
58
+ const shown = matches.has(open) ? open : (groups.find((g) => matches.has(g.name))?.name ?? open);
59
+ const group = groups.find((g) => g.name === shown);
60
+ const list = matches.get(shown) ?? [];
61
+ // The open group's settings, under headings by the rest of their group
62
+ // ("rate_limit.login"); its own settings first, with no heading.
63
+ const sections = new Map();
64
+ for (const s of list) {
65
+ const rest = s.group === shown ? "" : s.group.slice(shown.length + 1);
66
+ sections.set(rest, [...(sections.get(rest) ?? []), s]);
67
+ }
68
+ const saved = (s) => setAll((current) => current?.map((x) => (x.key === s.key ? s : x)) ?? null);
69
+ return (_jsxs("div", { className: "space-y-6", children: [_jsx(PageHeader, { title: "Settings", actions: _jsx("input", { type: "search", placeholder: "Find a setting", "aria-label": "Find a setting", value: filter, onChange: (e) => setFilter(e.target.value), className: `${input} max-w-xs` }) }), error !== "" && _jsx(Alert, { children: error }), _jsxs("div", { className: "grid items-start gap-6 lg:grid-cols-[20rem_minmax(0,1fr)]", children: [_jsx("nav", { "aria-label": "Groups of settings", className: "space-y-1 rounded-2xl border border-gray-200 bg-white p-3 lg:sticky lg:top-24 lg:max-h-[calc(100vh-8rem)] lg:overflow-y-auto dark:border-gray-800 dark:bg-white/[0.03]", children: groups.map((g) => {
70
+ const count = matches.get(g.name)?.length ?? 0;
71
+ const active = g.name === shown;
72
+ return (_jsxs("div", { className: `flex items-center gap-2 rounded-xl pr-3 transition-all duration-200 ${active
73
+ ? "bg-brand-500 text-white shadow-sm"
74
+ : "hover:translate-x-0.5 hover:bg-brand-50 dark:hover:bg-brand-500/10"} ${count === 0 ? "opacity-40" : ""}`, children: [_jsxs("button", { type: "button", disabled: count === 0, onClick: () => setOpen(g.name), className: "flex min-w-0 flex-1 items-center justify-between gap-3 py-3 pl-4 text-left", children: [_jsx("span", { className: `truncate font-medium ${active ? "" : "text-gray-800 dark:text-white/90"}`, children: g.title }), _jsx("span", { className: `rounded-full px-2 py-0.5 text-xs ${active
75
+ ? "bg-white/20"
76
+ : "bg-gray-100 text-gray-600 dark:bg-white/5 dark:text-gray-400"}`, children: count })] }), g.description !== "" && (_jsx(InfoTip, { label: `About ${g.title}`, className: active ? "border-white/60 text-white hover:bg-white/15" : undefined, children: g.description }))] }, g.name));
77
+ }) }), group !== undefined && (_jsx(Card, { title: group.title, info: group.description || undefined, children: _jsxs("div", { className: "-mx-6 -mb-6 border-t border-gray-100 dark:border-gray-800", children: [list.length === 0 && (_jsx("p", { className: "px-6 py-5 text-sm text-gray-500 dark:text-gray-400", children: "No setting here matches." })), [...sections].map(([rest, items]) => (_jsxs("section", { children: [rest !== "" && (_jsx("h3", { className: "bg-gray-50 px-6 py-2.5 text-xs font-medium tracking-wide text-gray-500 uppercase dark:bg-white/[0.02] dark:text-gray-400", children: rest.replaceAll(".", " · ").replaceAll("_", " ") })), _jsx("div", { className: "divide-y divide-gray-100 dark:divide-gray-800", children: items.map((s) => (_jsx(SettingRow, { setting: s, canManage: canManage, onSaved: saved }, s.key))) }), canManage && (s0(items) === "sms" || s0(items) === "mail") && (_jsx(SendTest, { channel: s0(items) }))] }, rest)))] }) }, shown))] })] }));
78
+ }
79
+ /** A setting's group on the left: the first part of its key ("auth"). */
80
+ function groupOf(s) {
81
+ return s.key.split(".")[0] ?? s.key;
82
+ }
83
+ /** The settings' own group ("sms"), which has a test to send. */
84
+ function s0(items) {
85
+ return items[0]?.group ?? "";
86
+ }
@@ -0,0 +1,5 @@
1
+ export interface SignInPageProps {
2
+ /** Where to go once signed in, unless the URL has ?next=. Default: /. */
3
+ home?: string;
4
+ }
5
+ export default function SignInPage({ home }: SignInPageProps): import("react").JSX.Element;
@@ -0,0 +1,117 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
+ // The sign-in page: with a password, or with a code emailed to the admin
4
+ // (no password), then the second factor when the account has two-factor
5
+ // sign-in on (docs/two-factor.md). The project's app/login/page.tsx
6
+ // re-exports it.
7
+ import { useState } from "react";
8
+ import * as verification from "../api/verification.gen";
9
+ import { AuthLayout } from "../auth-layout";
10
+ import { ApiError, call } from "../client";
11
+ import { ProofForm } from "../proof";
12
+ import { useConfig } from "../shell";
13
+ import { Alert, Button, CodeInput, Field } from "../ui";
14
+ export default function SignInPage({ home = "/" }) {
15
+ const { config, router } = useConfig();
16
+ const { Link } = router;
17
+ const [mode, setMode] = useState("password");
18
+ const [step, setStep] = useState({ kind: "form" });
19
+ const [code, setCode] = useState("");
20
+ const [error, setError] = useState("");
21
+ const [busy, setBusy] = useState(false);
22
+ const attempt = async (fn) => {
23
+ setError("");
24
+ setBusy(true);
25
+ try {
26
+ await fn();
27
+ }
28
+ catch (err) {
29
+ setError(err instanceof Error ? err.message : String(err));
30
+ }
31
+ finally {
32
+ setBusy(false);
33
+ }
34
+ };
35
+ // Signed in, or asked for the second factor.
36
+ const done = async (res) => {
37
+ if (res.mfa_required === true && res.mfa_token !== undefined) {
38
+ const { methods } = await call("/v1/reauth/2fa/methods", {
39
+ body: { mfa_token: res.mfa_token },
40
+ });
41
+ setStep({ kind: "mfa", token: res.mfa_token, methods });
42
+ return;
43
+ }
44
+ const next = new URLSearchParams(window.location.search).get("next");
45
+ // Only a path on this site, never another origin.
46
+ window.location.assign(next?.startsWith("/") && !next.startsWith("//") ? next : home);
47
+ };
48
+ const withPassword = (event) => {
49
+ event.preventDefault();
50
+ const f = new FormData(event.currentTarget);
51
+ attempt(async () => done(await call("/v1/auth/login", {
52
+ body: { email: f.get("email"), password: f.get("password") },
53
+ })));
54
+ };
55
+ const sendCode = (event) => {
56
+ event.preventDefault();
57
+ const email = String(new FormData(event.currentTarget).get("email")).trim();
58
+ attempt(async () => {
59
+ const sent = await call("/v1/auth/verifications", {
60
+ body: {
61
+ channel: "email",
62
+ email,
63
+ purpose: verification.PurposeLogin,
64
+ mode: "code",
65
+ },
66
+ idempotencyKey: crypto.randomUUID(),
67
+ });
68
+ setCode("");
69
+ setStep({ kind: "code", email, verificationId: sent.data.verification_id });
70
+ });
71
+ };
72
+ const withCode = (value) => {
73
+ if (step.kind !== "code") {
74
+ return;
75
+ }
76
+ attempt(async () => {
77
+ const verified = await call("/v1/auth/verifications/verify", {
78
+ body: { verification_id: step.verificationId, code: value },
79
+ });
80
+ await done(await call("/v1/auth/login/verified", {
81
+ body: { verification_token: verified.data.verification_token },
82
+ }));
83
+ });
84
+ };
85
+ if (step.kind === "mfa") {
86
+ return (_jsx(AuthLayout, { name: config.name, title: "Two-step verification", subtitle: "Your account asks for a second proof that it's you.", children: _jsx(ProofForm, { methods: step.methods, sendCode: async (channel) => {
87
+ const sent = await call("/v1/reauth/2fa/codes", {
88
+ body: { mfa_token: step.token, channel },
89
+ idempotencyKey: crypto.randomUUID(),
90
+ });
91
+ return sent.data.verification_id;
92
+ }, submit: async (proof) => {
93
+ try {
94
+ await done(await call("/v1/reauth/2fa/verify", {
95
+ body: { ...proof, mfa_token: step.token },
96
+ }));
97
+ }
98
+ catch (err) {
99
+ // The 5 minutes ran out, or it was finished: start again.
100
+ if (err instanceof ApiError && err.code === "auth.invalid_mfa_token") {
101
+ setStep({ kind: "form" });
102
+ setError(err.message);
103
+ }
104
+ throw err;
105
+ }
106
+ } }) }));
107
+ }
108
+ if (step.kind === "code") {
109
+ return (_jsx(AuthLayout, { name: config.name, title: "Check your email", subtitle: _jsxs(_Fragment, { children: ["We sent a code to ", _jsx("span", { className: "font-medium", children: step.email }), ". Enter it below."] }), footer: _jsx("button", { type: "button", className: "text-brand-500 hover:text-brand-600", onClick: () => setStep({ kind: "form" }), children: "Use a different email" }), children: _jsxs("div", { className: "animate-slide-in space-y-4", children: [error !== "" && _jsx(Alert, { children: error }), _jsx(CodeInput, { value: code, onChange: setCode, onComplete: withCode, disabled: busy }), _jsx(Button, { busy: busy, onClick: () => withCode(code), children: "Sign in" })] }) }));
110
+ }
111
+ return (_jsxs(AuthLayout, { name: config.name, title: "Sign in", subtitle: "Welcome back. Sign in to continue.", children: [_jsx("div", { className: "mb-6 grid grid-cols-2 gap-1 rounded-lg bg-gray-100 p-1 text-sm dark:bg-gray-800", children: ["password", "code"].map((m) => (_jsx("button", { type: "button", onClick: () => {
112
+ setMode(m);
113
+ setError("");
114
+ }, className: `rounded-md px-3 py-2 transition ${mode === m
115
+ ? "bg-white text-gray-800 shadow-sm dark:bg-gray-900 dark:text-white/90"
116
+ : "text-gray-500 hover:text-gray-700 dark:text-gray-400"}`, children: m === "password" ? "Password" : "Email code" }, m))) }), error !== "" && _jsx(Alert, { children: error }), mode === "password" ? (_jsxs("form", { className: "animate-fade-in space-y-5", onSubmit: withPassword, children: [_jsx(Field, { label: "Email", name: "email", type: "email", autoComplete: "username" }), _jsx(Field, { label: "Password", name: "password", type: "password", autoComplete: "current-password" }), _jsx("div", { className: "flex justify-end", children: _jsx(Link, { href: "/forgot-password", className: "text-sm text-brand-500 hover:text-brand-600", children: "Forgot password?" }) }), _jsx(Button, { type: "submit", busy: busy, children: "Sign in" })] }, "password")) : (_jsxs("form", { className: "animate-fade-in space-y-5", onSubmit: sendCode, children: [_jsx(Field, { label: "Email", name: "email", type: "email", autoComplete: "username" }), _jsx("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: "We'll email you a code: no password needed." }), _jsx(Button, { type: "submit", busy: busy, children: "Email me a code" })] }, "code"))] }));
117
+ }
@@ -0,0 +1 @@
1
+ export default function StatusPage(): import("react").JSX.Element;
@@ -0,0 +1,122 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
+ // The system status report (docs/health.md): each check, the job queues
4
+ // and workers, and the API process. Loaded again every 15 seconds (the API
5
+ // runs the checks at most every 5). Warns when the API's colveor-go release
6
+ // isn't this panel's.
7
+ import { useEffect, useState } from "react";
8
+ import { ApiError, api } from "../client";
9
+ import { formatDateTime } from "../dates";
10
+ import { PageHeader } from "../kit/page-header";
11
+ import { Alert } from "../ui";
12
+ import { version } from "../version";
13
+ const TONE = {
14
+ ok: "bg-green-50 text-green-700 dark:bg-green-500/15 dark:text-green-500",
15
+ degraded: "bg-amber-50 text-amber-700 dark:bg-amber-500/15 dark:text-amber-400",
16
+ down: "bg-red-50 text-red-600 dark:bg-red-500/15 dark:text-red-500",
17
+ disabled: "bg-gray-100 text-gray-600 dark:bg-white/5 dark:text-gray-400",
18
+ };
19
+ export default function StatusPage() {
20
+ const [report, setReport] = useState(null);
21
+ const [error, setError] = useState("");
22
+ useEffect(() => {
23
+ const load = () => api
24
+ .get("/v1/health/status")
25
+ .then((r) => {
26
+ setReport(r);
27
+ setError("");
28
+ })
29
+ .catch((err) => {
30
+ // Down is a 503 that still carries the report.
31
+ const body = err instanceof ApiError ? err.body : {};
32
+ if (body.checks !== undefined) {
33
+ setReport(body);
34
+ setError("");
35
+ }
36
+ else {
37
+ setError(err.message);
38
+ }
39
+ });
40
+ load();
41
+ const timer = setInterval(load, 15_000);
42
+ return () => clearInterval(timer);
43
+ }, []);
44
+ const queueCheck = report?.checks.queue;
45
+ const others = Object.entries(report?.checks ?? {})
46
+ .filter(([name]) => name !== "queue")
47
+ .sort(([a], [b]) => a.localeCompare(b));
48
+ return (_jsxs("div", { className: "space-y-6", children: [_jsx(PageHeader, { title: "System status", actions: _jsxs(_Fragment, { children: [report !== null && _jsx(Badge, { status: report.status }), report !== null && (_jsxs("span", { className: "text-sm text-gray-500 dark:text-gray-400", children: ["checked ", new Date(report.checked_at).toLocaleTimeString()] }))] }) }), error !== "" && _jsx(Alert, { children: error }), report !== null && _jsx(VersionWarning, { api: report.process.framework_version }), _jsx("div", { className: "grid gap-4 md:grid-cols-2 xl:grid-cols-3", children: others.map(([name, check]) => (_jsx(Card, { title: name, check: check, children: _jsx(Details, { value: check.details }) }, name))) }), queueCheck !== undefined && (_jsx(Card, { title: "queue", check: queueCheck, children: queueCheck.details !== undefined && _jsx(Queues, { stats: queueCheck.details }) })), report !== null && (_jsx(Card, { title: "API process", children: _jsx(Details, { value: {
49
+ app: report.process.app,
50
+ env: report.process.env,
51
+ framework: report.process.framework_version,
52
+ started: formatDateTime(report.process.started_at),
53
+ uptime: duration(report.process.uptime_seconds),
54
+ go: report.process.go_version,
55
+ cpus: report.process.cpus,
56
+ goroutines: report.process.goroutines,
57
+ heap: bytes(report.process.heap_bytes),
58
+ } }) }))] }));
59
+ }
60
+ /** The panel and the API should be on the same colveor-go major and minor. */
61
+ function VersionWarning({ api: apiVersion }) {
62
+ const minor = (v) => v.replace(/^v/, "").split(".").slice(0, 2).join(".");
63
+ if (!apiVersion.startsWith("v") || minor(apiVersion) === minor(version)) {
64
+ // "(devel)" or empty: a local checkout, nothing to compare.
65
+ return null;
66
+ }
67
+ return (_jsxs(Alert, { children: ["The API runs colveor-go ", apiVersion, ", but this panel's @colveor/admin is ", version, ". Update the one that is behind, so the pages match the API."] }));
68
+ }
69
+ function Card(props) {
70
+ const { check } = props;
71
+ return (_jsxs("section", { className: "rounded-2xl border border-gray-200 bg-white p-5 dark:border-gray-800 dark:bg-white/[0.03]", children: [_jsxs("div", { className: "mb-3 flex flex-wrap items-center gap-2", children: [_jsx("h2", { className: "font-medium text-gray-800 dark:text-white/90", children: props.title }), check !== undefined && _jsx(Badge, { status: check.status }), check?.critical && _jsx("span", { className: "text-xs text-gray-500", children: "critical" }), check !== undefined && (_jsxs("span", { className: "ml-auto text-xs text-gray-500", children: [check.latency_ms.toFixed(1), " ms"] }))] }), check?.message && _jsx("p", { className: "mb-3 text-sm text-red-600", children: check.message }), props.children] }));
72
+ }
73
+ function Badge({ status }) {
74
+ return (_jsx("span", { className: `rounded-full px-2.5 py-0.5 text-xs font-medium ${TONE[status] ?? ""}`, children: status }));
75
+ }
76
+ /** A check's details: whatever the check reports, as name and value rows. */
77
+ function Details({ value }) {
78
+ if (value === null || typeof value !== "object") {
79
+ return null;
80
+ }
81
+ return (_jsx("dl", { className: "grid grid-cols-2 gap-x-4 gap-y-1 text-sm", children: Object.entries(value).map(([k, v]) => (_jsxs("div", { className: "contents", children: [_jsx("dt", { className: "text-gray-500 dark:text-gray-400", children: k.replaceAll("_", " ") }), _jsx("dd", { className: "text-gray-800 dark:text-white/90", children: k.endsWith("_bytes") && typeof v === "number"
82
+ ? bytes(v)
83
+ : typeof v === "object"
84
+ ? JSON.stringify(v)
85
+ : String(v) })] }, k))) }));
86
+ }
87
+ function Queues({ stats }) {
88
+ const th = "px-3 py-2 font-medium";
89
+ const td = "px-3 py-2";
90
+ return (_jsxs("div", { className: "space-y-5 overflow-x-auto text-sm", children: [_jsxs("table", { className: "min-w-full text-left", children: [_jsx("thead", { className: "text-gray-500 dark:text-gray-400", children: _jsx("tr", { children: [
91
+ "Queue",
92
+ "Pending",
93
+ "Active",
94
+ "Scheduled",
95
+ "Retrying",
96
+ "Archived",
97
+ "Done today",
98
+ "Failed today",
99
+ "Oldest waits",
100
+ ].map((h) => (_jsx("th", { className: th, children: h }, h))) }) }), _jsx("tbody", { className: "text-gray-800 dark:text-white/90", children: stats.queues.map((q) => (_jsxs("tr", { children: [_jsxs("td", { className: td, children: [q.name, q.paused && _jsx("span", { className: "ml-2 text-xs text-amber-600", children: "paused" })] }), _jsx("td", { className: td, children: q.pending }), _jsx("td", { className: td, children: q.active }), _jsx("td", { className: td, children: q.scheduled }), _jsx("td", { className: td, children: q.retry }), _jsx("td", { className: q.archived > 0 ? `${td} text-red-600` : td, children: q.archived }), _jsx("td", { className: td, children: q.processed_today }), _jsx("td", { className: q.failed_today > 0 ? `${td} text-red-600` : td, children: q.failed_today }), _jsx("td", { className: td, children: duration(q.latency_seconds) })] }, q.name))) })] }), _jsxs("div", { children: [_jsx("h3", { className: "mb-2 font-medium text-gray-800 dark:text-white/90", children: "Workers" }), stats.workers.length === 0 ? (_jsx("p", { className: "text-red-600", children: "No worker is running: jobs wait until one starts." })) : (_jsx("ul", { className: "space-y-1 text-gray-700 dark:text-gray-300", children: stats.workers.map((w) => (_jsxs("li", { children: [w.host, " (pid ", w.pid, "): ", w.busy, " of ", w.concurrency, " busy on ", w.queues.join(", "), ", up ", duration((Date.now() - Date.parse(w.started_at)) / 1000)] }, `${w.host}-${w.pid}-${w.queues.join()}`))) }))] }), stats.jobs.length > 0 && (_jsxs("table", { className: "min-w-full text-left", children: [_jsx("thead", { className: "text-gray-500 dark:text-gray-400", children: _jsx("tr", { children: ["Job type (today)", "Done", "Failed", "Average", "Last run"].map((h) => (_jsx("th", { className: th, children: h }, h))) }) }), _jsx("tbody", { className: "text-gray-800 dark:text-white/90", children: stats.jobs.map((j) => (_jsxs("tr", { children: [_jsx("td", { className: `${td} font-mono text-xs`, children: j.type }), _jsx("td", { className: td, children: j.processed_today }), _jsx("td", { className: j.failed_today > 0 ? `${td} text-red-600` : td, children: j.failed_today }), _jsxs("td", { className: td, children: [j.average_ms.toFixed(0), " ms"] }), _jsx("td", { className: td, children: new Date(j.last_run_at).toLocaleTimeString() })] }, j.type))) })] }))] }));
101
+ }
102
+ function duration(seconds) {
103
+ if (seconds < 60) {
104
+ return `${Math.round(seconds)} s`;
105
+ }
106
+ if (seconds < 3600) {
107
+ return `${Math.round(seconds / 60)} min`;
108
+ }
109
+ if (seconds < 86_400) {
110
+ return `${(seconds / 3600).toFixed(1)} h`;
111
+ }
112
+ return `${(seconds / 86_400).toFixed(1)} days`;
113
+ }
114
+ function bytes(n) {
115
+ const units = ["B", "KB", "MB", "GB"];
116
+ let i = 0;
117
+ while (n >= 1024 && i < units.length - 1) {
118
+ n /= 1024;
119
+ i++;
120
+ }
121
+ return `${n.toFixed(i === 0 ? 0 : 1)} ${units[i]}`;
122
+ }
@@ -0,0 +1 @@
1
+ export default function SupportPage(): import("react").JSX.Element;
@@ -0,0 +1,90 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ // Support access, the platform admin's side (docs/support-access.md): ask a
4
+ // team for one of its roles for a while, your grants (end one early), and
5
+ // every grant (support.read). The team approves in the project's app
6
+ // (<TeamSupportGrants>), unless support_access.approval is notify.
7
+ import { useEffect, useState } from "react";
8
+ import * as support from "../api/support_access.gen";
9
+ import { api } from "../client";
10
+ import { formatDateTime } from "../dates";
11
+ import { PageHeader } from "../kit/page-header";
12
+ import { useCan } from "../shell";
13
+ import { grantColumns, useGrantChange } from "../support";
14
+ import { DataTable } from "../table";
15
+ import { Alert } from "../ui";
16
+ const input = "w-full rounded-lg border border-gray-300 bg-transparent px-3 py-2 text-sm text-gray-800 focus:border-brand-300 focus:outline-none dark:border-gray-700 dark:text-white/90";
17
+ const card = "space-y-4 rounded-2xl border border-gray-200 bg-white p-5 dark:border-gray-800 dark:bg-white/[0.03]";
18
+ export default function SupportPage() {
19
+ const canRequest = useCan(support.PermissionRequest);
20
+ const canRead = useCan(support.PermissionRead);
21
+ const { change, error, reload, refresh, dialogs } = useGrantChange();
22
+ const [status, setStatus] = useState("");
23
+ const end = (g) => change((o) => api.post(`/v1/support-grants/${g.id}/end`, undefined, o));
24
+ const open = (g) => (g.status === support.StatusPending || g.status === support.StatusActive) &&
25
+ Date.parse(g.ends_at) > Date.now();
26
+ return (_jsxs("div", { className: "space-y-6", children: [_jsx(PageHeader, { title: "Support access" }), error !== "" && _jsx(Alert, { children: error }), canRequest && _jsx(RequestAccess, { onDone: refresh }), canRead && (_jsxs("section", { className: card, children: [_jsx("div", { className: "flex flex-wrap items-center justify-between gap-3", children: _jsx("h2", { className: "font-medium text-gray-800 dark:text-white/90", children: "My grants" }) }), _jsx(DataTable, { path: "/v1/support-grants", query: { mine: true }, reload: reload, empty: "You haven't asked for access.", columns: grantColumns([
27
+ {
28
+ header: "",
29
+ cell: (g) => open(g) && (_jsx("button", { type: "button", onClick: () => end(g), className: "rounded-lg border border-gray-300 px-3 py-1.5 text-xs text-gray-700 hover:bg-gray-50 dark:border-gray-700 dark:text-gray-300", children: "End" })),
30
+ },
31
+ ]) })] })), canRead && (_jsxs("section", { className: card, children: [_jsxs("div", { className: "flex flex-wrap items-center justify-between gap-3", children: [_jsx("h2", { className: "font-medium text-gray-800 dark:text-white/90", children: "Every grant" }), _jsxs("select", { "aria-label": "Status", value: status, onChange: (e) => setStatus(e.target.value), className: `${input} max-w-48`, children: [_jsx("option", { value: "", children: "Any status" }), [
32
+ support.StatusPending,
33
+ support.StatusActive,
34
+ support.StatusDenied,
35
+ support.StatusRevoked,
36
+ support.StatusEnded,
37
+ ].map((s) => (_jsx("option", { value: s, children: s }, s)))] })] }), _jsx(DataTable, { path: "/v1/support-grants", query: { status }, reload: reload, empty: "No grant.", columns: grantColumns([
38
+ {
39
+ header: "By",
40
+ cell: (g) => _jsx("span", { className: "font-mono text-xs", children: g.requested_by }),
41
+ },
42
+ ]) })] })), dialogs] }));
43
+ }
44
+ function RequestAccess({ onDone }) {
45
+ const [kind, setKind] = useState("");
46
+ const [roles, setRoles] = useState([]);
47
+ const [error, setError] = useState("");
48
+ const [result, setResult] = useState(null);
49
+ const [busy, setBusy] = useState(false);
50
+ // The roles this kind gives: one of them is asked for.
51
+ useEffect(() => {
52
+ setRoles([]);
53
+ if (kind === "") {
54
+ return;
55
+ }
56
+ const timer = setTimeout(() => {
57
+ api
58
+ .get(`/v1/teams/${encodeURIComponent(kind)}/roles`)
59
+ .then(setRoles)
60
+ .catch(() => setRoles([]));
61
+ }, 300);
62
+ return () => clearTimeout(timer);
63
+ }, [kind]);
64
+ const submit = async (event) => {
65
+ event.preventDefault();
66
+ const f = new FormData(event.currentTarget);
67
+ const hours = Number(f.get("hours"));
68
+ setError("");
69
+ setResult(null);
70
+ setBusy(true);
71
+ try {
72
+ // The reason is the team's to read: asked here, sent as X-Reason.
73
+ const g = await api.post(`/v1/teams/${encodeURIComponent(kind)}/${encodeURIComponent(String(f.get("id")).trim())}/support-grants`, {
74
+ role: f.get("role"),
75
+ ends_at: new Date(Date.now() + hours * 3_600_000).toISOString(),
76
+ }, { reason: String(f.get("reason")).trim() });
77
+ setResult(g);
78
+ onDone();
79
+ }
80
+ catch (err) {
81
+ setError(err instanceof Error ? err.message : String(err));
82
+ }
83
+ finally {
84
+ setBusy(false);
85
+ }
86
+ };
87
+ return (_jsxs("section", { className: card, children: [_jsx("h2", { className: "font-medium text-gray-800 dark:text-white/90", children: "Ask a team for access" }), _jsxs("form", { onSubmit: submit, className: "grid gap-3 md:grid-cols-2", children: [_jsx("input", { required: true, "aria-label": "Kind", placeholder: "Kind (store)", value: kind, onChange: (e) => setKind(e.target.value.trim()), className: input }), _jsx("input", { name: "id", required: true, "aria-label": "Team ID", placeholder: "Team ID", className: `${input} font-mono` }), _jsxs("select", { name: "role", required: true, "aria-label": "Role", className: input, defaultValue: "", children: [_jsx("option", { value: "", disabled: true, children: roles.length === 0 ? "Type the kind to see its roles" : "The role you need" }), roles.map((r) => (_jsxs("option", { value: r.slug, children: [r.name, " (", r.slug, ", level ", r.level, ")"] }, r.slug)))] }), _jsx("select", { name: "hours", "aria-label": "For how long", className: input, defaultValue: "4", children: [1, 2, 4, 8, 24].map((h) => (_jsxs("option", { value: h, children: ["For ", h, " ", h === 1 ? "hour" : "hours"] }, h))) }), _jsx("input", { name: "reason", required: true, "aria-label": "Reason", placeholder: "Why (the team reads this): ticket, problem", className: `${input} md:col-span-2` }), _jsx("div", { className: "md:col-span-2", children: _jsx("button", { type: "submit", disabled: busy, className: "rounded-lg bg-brand-500 px-4 py-2 text-sm font-medium text-white hover:bg-brand-600 disabled:opacity-40", children: "Ask for access" }) })] }), error !== "" && _jsx(Alert, { children: error }), result !== null && (_jsx("p", { className: "text-sm text-gray-700 dark:text-gray-300", children: result.status === support.StatusActive
88
+ ? `Active until ${formatDateTime(result.ends_at)}.`
89
+ : "Waiting for the team to approve it." }))] }));
90
+ }
@@ -0,0 +1 @@
1
+ export default function TeamsPage(): import("react").JSX.Element;