import { ShieldCheck } from "lucide-react"; import { EmptyState } from "@/client/components/ui"; import { IslandHost } from "@/client/server/IslandHost"; import { RepositoriesIsland } from "@/client/islands/repositories"; import { TokensIsland, type TokensIslandSummary } from "@/client/islands/tokens"; export type AccountNamespace = { id: string; slug: string; }; export type AccountRepository = { id: string; slug: string; namespaceSlug: string; visibility: "public" | "private"; updatedAt: number; }; export type AccountPageProps = { userId: string; primaryNamespaceSlug?: string; namespaces: AccountNamespace[]; repositories: AccountRepository[]; tokens: TokensIslandSummary[]; }; function truncateUserId(userId: string): string { if (userId.length <= 12) return userId; return `${userId.slice(0, 8)}…${userId.slice(-4)}`; } export function AccountPage({ userId, primaryNamespaceSlug, namespaces, repositories, tokens, }: AccountPageProps) { const handle = primaryNamespaceSlug ? `@${primaryNamespaceSlug}` : "Identity not yet claimed"; return (

Identity

{handle}

id {truncateUserId(userId)}

Namespaces

{namespaces.length === 0 ? (

Repositories

Tokens

Personal access tokens scope to a namespace or a single repo. The plaintext is shown only once at creation.

); }