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

Function UserFooter

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

useAuthFunction · 0.90

Tested by

no test coverage detected