@orangecheck/ui / OcAccountMenuItem
Interface: OcAccountMenuItem
Defined in: account-menu.tsx:49
<OcAccountMenu> — the canonical top-right account affordance for
every family site. Replaces the older inline-styled OcAccountChip
from @orangecheck/auth-client with a Tailwind-styled, fully
configurable, cross-site-aware dropdown.
Three explicit visual states:
- Pre-hydration / loading — neutral
sign inplaceholder so the header never goes blank on first paint. - Anonymous / error — primary-styled
sign inCTA pointing at the site's local/signin(or whateversignInUrlyou pass). - Authenticated — pill with a primary-tinted signal dot and shortened did_oc (or display name if set); click → popover with the full did_oc as a one-click copy-to-clipboard row, optional site-specific menu items, family dashboard link, sign-out, and an optional BuildFooter showing site name + version + commit sha → GitHub.
Cross-site recognition: the component re-fetches the session on
visibilitychange and focus events, so when a user signs in at a
sibling site (ochk.io, attest.ochk.io, etc.) and tabs back, the
chip flips from "sign in" to "signed in" without a hard reload.
The component reads useOcSession() from @orangecheck/auth-client,
so the consuming app must mount <OcSessionProvider> somewhere in
its tree (already standard in every consumer's _app.tsx).
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
<a id="property-external"></a> external? | boolean | When true, opens in a new tab and renders a ↗ glyph after the label. Use for cross-domain links (e.g. https://ochk.io/dashboard). | account-menu.tsx:58 |
<a id="property-href"></a> href | string | Same-origin path or absolute URL. | account-menu.tsx:51 |
<a id="property-label"></a> label | string | Visible label. | account-menu.tsx:53 |