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

Function UserFooter

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

useAuthFunction · 0.90

Tested by

no test coverage detected