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

Function UserFooter

packages/react/src/multiplayer/shell.tsx:277–340  ·  view source on GitHub ↗
(props: Pick<ShellProps, "onSignOut" | "orgMenuSlot">)

Source from the content-addressed store, hash-verified

275// ── UserFooter ──────────────────────────────────────────────────────────
276
277function UserFooter(props: Pick<ShellProps, "onSignOut" | "orgMenuSlot">) {
278 const auth = useAuth();
279 if (auth.status !== "authenticated") return null;
280
281 return (
282 <div className="shrink-0 border-t border-sidebar-border px-3 py-2.5">
283 <DropdownMenu>
284 <DropdownMenuTrigger asChild>
285 <Button
286 type="button"
287 variant="ghost"
288 className="flex h-auto w-full items-center justify-start gap-2.5 rounded-md px-1 py-1 text-left hover:bg-sidebar-active/60"
289 >
290 <Avatar url={auth.user.avatarUrl} name={auth.user.name} email={auth.user.email} />
291 <div className="min-w-0 flex-1">
292 <p className="truncate text-xs font-medium text-foreground">
293 {auth.user.name ?? auth.user.email}
294 </p>
295 {auth.organization && (
296 <p className="truncate text-xs text-muted-foreground">{auth.organization.name}</p>
297 )}
298 </div>
299 <svg
300 viewBox="0 0 16 16"
301 fill="none"
302 className="size-3.5 shrink-0 text-muted-foreground"
303 >
304 <path
305 d="M4 6l4 4 4-4"
306 stroke="currentColor"
307 strokeWidth="1.3"
308 strokeLinecap="round"
309 strokeLinejoin="round"
310 />
311 </svg>
312 </Button>
313 </DropdownMenuTrigger>
314 <DropdownMenuContent align="start" side="top" className="w-64">
315 {props.orgMenuSlot}
316 <DropdownMenuLabel className="text-xs font-normal text-muted-foreground">
317 Signed in as
318 </DropdownMenuLabel>
319 <DropdownMenuItem disabled className="gap-2 text-xs opacity-100">
320 <Avatar url={auth.user.avatarUrl} name={auth.user.name} email={auth.user.email} />
321 <div className="min-w-0 flex-1">
322 <p className="truncate font-medium text-foreground">
323 {auth.user.name ?? auth.user.email}
324 </p>
325 {auth.user.name && (
326 <p className="truncate text-muted-foreground">{auth.user.email}</p>
327 )}
328 </div>
329 </DropdownMenuItem>
330 <DropdownMenuItem
331 className="text-xs text-destructive focus:text-destructive"
332 onClick={() => void props.onSignOut()}
333 >
334 Sign out

Callers

nothing calls this directly

Calls 1

useAuthFunction · 0.90

Tested by

no test coverage detected