* 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 })
| 323 | * identifies them to logs and to the API. |
| 324 | */ |
| 325 | function UserDetailTitle(props: { readonly user: AdminUserRow }) { |
| 326 | const title = adminUserTitle(props.user); |
| 327 | const email = adminUserCopyableEmail(props.user); |
| 328 | |
| 329 | return ( |
| 330 | <div className="flex min-w-0 flex-col gap-1"> |
| 331 | <div className="flex min-w-0 items-center gap-1"> |
| 332 | <SheetTitle |
| 333 | data-slot="admin-user-detail-title" |
| 334 | className={ |
| 335 | title.primaryIsId ? "truncate font-mono text-sm" : "truncate text-sm font-semibold" |
| 336 | } |
| 337 | title={title.primary} |
| 338 | > |
| 339 | {title.primary} |
| 340 | </SheetTitle> |
| 341 | {email ? ( |
| 342 | <CopyButton value={email} label="Copy email" /> |
| 343 | ) : ( |
| 344 | title.primaryIsId && <CopyButton value={props.user.externalId} label="Copy ID" /> |
| 345 | )} |
| 346 | </div> |
| 347 | {title.secondary !== null && ( |
| 348 | <div className="flex min-w-0 items-center gap-1"> |
| 349 | <span |
| 350 | data-slot="admin-user-detail-id" |
| 351 | className="truncate font-mono text-[11px] text-muted-foreground" |
| 352 | title={props.user.externalId} |
| 353 | > |
| 354 | {props.user.externalId} |
| 355 | </span> |
| 356 | <CopyButton value={props.user.externalId} label="Copy ID" /> |
| 357 | </div> |
| 358 | )} |
| 359 | </div> |
| 360 | ); |
| 361 | } |
| 362 | |
| 363 | // ── Detail sheet ──────────────────────────────────────────────────────────── |
| 364 |
nothing calls this directly
no test coverage detected