Home / Function/ UserRoleButtonSection() — supabase Function Reference

UserRoleButtonSection() — supabase Function Reference

Architecture documentation for the UserRoleButtonSection() function in RoleImpersonationPopover.tsx from the supabase codebase.

Entity Profile

Dependency Diagram

graph TD
  c1673233_a37e_6c09_2909_6f7383199c11["UserRoleButtonSection()"]
  d44a1c3b_079d_7fa6_71ab_78eb4daff73a["getAvatarUrl()"]
  c1673233_a37e_6c09_2909_6f7383199c11 -->|calls| d44a1c3b_079d_7fa6_71ab_78eb4daff73a
  3c05a680_a8e3_7a53_e059_ae8513da59ad["getDisplayName()"]
  c1673233_a37e_6c09_2909_6f7383199c11 -->|calls| 3c05a680_a8e3_7a53_e059_ae8513da59ad
  style c1673233_a37e_6c09_2909_6f7383199c11 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

apps/studio/components/interfaces/RoleImpersonationSelector/RoleImpersonationPopover.tsx lines 71–87

const UserRoleButtonSection = ({ user }: { user: User }) => {
  const avatarUrl = getAvatarUrl(user)
  const displayName = getDisplayName(user, user.email ?? user.phone ?? user.id ?? 'Unknown')

  return (
    <div className="flex gap-1 items-center pl-0.5 pr-1.5 h-[21px] bg-surface-200 rounded-full overflow-hidden">
      {avatarUrl ? (
        <img className="rounded-full w-[18px] h-[18px]" src={avatarUrl} alt={displayName} />
      ) : (
        <div className="rounded-full w-[18px] h-[18px] bg-surface-100 border flex items-center justify-center text-light">
          <IconUser size={12} strokeWidth={2} />
        </div>
      )}
      <span className="truncate max-w-[84px]">{displayName}</span>
    </div>
  )
}

Subdomains

Frequently Asked Questions

What does UserRoleButtonSection() do?
UserRoleButtonSection() is a function in the supabase codebase.
What does UserRoleButtonSection() call?
UserRoleButtonSection() calls 2 function(s): getAvatarUrl, getDisplayName.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free