Files
causius/components/AccountControl.tsx
CatoandClaude Opus 5.5 40a5c4b05d Matters, the fleet design system and a technical narrative (#10)
* Matters: encrypted, agentic legal workspace behind OrangeCat sign-in

A matter is sealed per matter (AES-256-GCM data key under CAUSIUS_MASTER_KEY).
The agent works it with tools (search, read, deadlines, tasks, drafts,
approvals); every personal detail is swapped for a placeholder before a model
sees it, and the person's account name is always one of them. The database in
the clear holds no name, message, deadline or document.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012EJFFkKhmaVnnH8E3mHnaZ

* Fleet design system, a technical narrative, one account across the fleet, domain checks

- @bitbaum/design-tokens replaces the bespoke paper-and-ink theme; Solon's
  grammar (kicker, headline-caps, btn-frame) for every page, pinned dark.
- New Platform, Security and Ecosystem pages; the home page rebuilt around what
  works today (lib/capabilities.ts is the one place a status is decided).
- Sign-in and sign-up routes hand straight to OrangeCat; the account menu and
  the ecosystem page link the rest of the fleet, read from the fleet map.
- The agent can check domain names with the registries over RDAP.
- The i18n parity test reads ICU properly (select branches, apostrophes).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012EJFFkKhmaVnnH8E3mHnaZ

* Provision matters on the host: database, OrangeCat client, runtime env

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012EJFFkKhmaVnnH8E3mHnaZ

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-11 12:23:14 -07:00

73 lines
2.1 KiB
TypeScript

"use client";
import { AccountMenu } from "@bitbaum/accountkit";
import { useTranslations } from "next-intl";
import { Link } from "@/i18n/navigation";
import { ROUTES } from "@/lib/routes";
/**
* The fleet's one account menu (@bitbaum/accountkit), with Causius's places.
* Sign-in is a link to OrangeCat's one screen; sign-out a server action passed
* in, so this file holds no auth logic of its own.
*/
export function AccountControl({
user,
signInHref,
signOutAction,
fleet,
}: {
user: { name?: string | null; image?: string | null } | null;
/** /<locale>/sign-in?from=… — a plain link, see lib/auth/entry.ts. */
signInHref: string;
signOutAction: () => Promise<void>;
/** The other fleet products this one account opens, from the fleet map. */
fleet: { slug: string; name: string; url: string }[];
}) {
const t = useTranslations("Account");
if (!user) {
return (
<a href={signInHref} className="btn-secondary">
{t("signIn")}
</a>
);
}
return (
<AccountMenu
user={{ name: user.name ?? undefined, image: user.image ?? undefined }}
groups={[
{
id: "places",
items: [
{ id: "matters", label: t("matters"), href: ROUTES.matters },
{ id: "settings", label: t("settings"), href: ROUTES.settings },
],
},
// The same account opens the rest of the fleet; say so where the
// person looks for their account.
...(fleet.length
? [{ id: "fleet", items: fleet.map((p) => ({ id: p.slug, label: t("openIn", { name: p.name }), href: p.url })) }]
: []),
]}
onSignOut={() => signOutAction()}
renderLink={({ href, children, ...rest }) =>
href.startsWith("https://") ? (
<a href={href} {...rest}>
{children}
</a>
) : (
<Link href={href} {...rest}>
{children}
</Link>
)
}
labels={{
trigger: t("trigger"),
menu: t("menu"),
signOut: t("signOut"),
signingOut: t("signingOut"),
signOutFailed: t("signOutFailed"),
}}
/>
);
}