MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / UserDetailTitle

Function UserDetailTitle

packages/react/src/pages/admin-users.tsx:327–363  ·  view source on GitHub ↗

* 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 })

Source from the content-addressed store, hash-verified

325 * identifies them to logs and to the API.
326 */
327function 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

Callers

nothing calls this directly

Calls 2

adminUserTitleFunction · 0.90
adminUserCopyableEmailFunction · 0.90

Tested by

no test coverage detected