import { useUser } from "@squadbase/react" import type { User } from "@squadbase/react" import { UserIcon } from "lucide-react" import { Badge, Dialog, DialogContent, DialogHeader, DialogTitle, DialogTrigger, cn, } from "@squadbase/vantage/ui" export function UserCard() { const userState = useUser() if (userState.status === "success") { return } return } /** * Squadbase-authenticated user chip for the app shell. * * The Vantage UI kit has no `Avatar`, so the initials bubble is inlined here — * it is a handful of classes and only ever used by this component. */ function Avatar({ user, className }: { user: User; className?: string }) { const fullName = `${user.firstName} ${user.lastName}` const initials = `${user.firstName.charAt(0)}${user.lastName.charAt(0)}` return ( {user.iconUrl ? ( {fullName} ) : ( initials )} ) } function DetailRow({ label, children }: { label: string; children: React.ReactNode }) { return (

{label}

{children}
) } function UserInfo({ user }: { user: User }) { const fullName = `${user.firstName} ${user.lastName}` const rolesHref = document.documentElement.lang.startsWith("ja") ? "https://www.squadbase.dev/ja/docs/access-control#プロジェクトロール" : "https://www.squadbase.dev/docs/access-control#project-roles" return ( } > {fullName} {user.email} User Details
{fullName} {user.username} {user.email}

Project Roles

Learn more
{user.roles.length > 0 ? (
{user.roles.map((role) => ( {role} ))}
) : (

No roles assigned

)}
) } function UserInfoFallback() { return (
Guest Unable to retrieve user information
) }