* The sheet header: the same title treatment as the row, plus the copy * affordances the row can't carry. * * Two separate buttons rather than one, because they yield different things and * an operator wants a specific one: the email is what they paste into a mail * client or a support ticket,
(props: { readonly user: AdminUserRow })
| 325 | * identifies them to logs and to the API. |
| 326 | */ |
| 327 | function UserDetailTitle(props: { readonly user: AdminUserRow }) { |
| 328 | const title = adminUserTitle(props.user); |
| 329 | const email = adminUserCopyableEmail(props.user); |
| 330 | |
| 331 | return ( |
| 332 | <div className="flex min-w-0 flex-col gap-1"> |
| 333 | <div className="flex min-w-0 items-center gap-1"> |
| 334 | <SheetTitle |
| 335 | data-slot="admin-user-detail-title" |
| 336 | className={ |
| 337 | title.primaryIsId ? "truncate font-mono text-sm" : "truncate text-sm font-semibold" |
| 338 | } |
| 339 | title={title.primary} |
| 340 | > |
| 341 | {title.primary} |
| 342 | </SheetTitle> |
| 343 | {email ? ( |
| 344 | <CopyButton value={email} label="Copy email" /> |
| 345 | ) : ( |
| 346 | title.primaryIsId && <CopyButton value={props.user.externalId} label="Copy ID" /> |
| 347 | )} |
| 348 | </div> |
| 349 | {title.secondary !== null && ( |
| 350 | <div className="flex min-w-0 items-center gap-1"> |
| 351 | <span |
| 352 | data-slot="admin-user-detail-id" |
| 353 | className="truncate font-mono text-[11px] text-muted-foreground" |
| 354 | title={props.user.externalId} |
| 355 | > |
| 356 | {props.user.externalId} |
| 357 | </span> |
| 358 | <CopyButton value={props.user.externalId} label="Copy ID" /> |
| 359 | </div> |
| 360 | )} |
| 361 | </div> |
| 362 | ); |
| 363 | } |
| 364 | |
| 365 | // ── Detail sheet ──────────────────────────────────────────────────────────── |
| 366 |
nothing calls this directly
no test coverage detected