1import{a as u,r as d,m as o,j as e,D as x,f as g,g as f,k as r,L as h,s as t,e as j}from"./main-HVf8ATPQ.js";import{g as N}from"./avatar-config-Cv0gN0fX.js";import{U as w}from"./user-avatar-BxGEjwXf.js";import{t as v}from"./index-CTmY_VWW.js";import{a as D}from"./IconLogout-BLkr491h.js";import"./IconSettings2-BRPuQ4OJ.js";import"./IconKey-Cgv8OyVa.js";import"./IconBookmark-DX6lphi0.js";import"./IconReceipt2-BHkvBUuJ.js";import"./avatar-CNW2Ya6W.js";import"./IconUser-DKi8qpqN.js";function A({user:a}){const i=u(),l=N(),[c,n]=d.useState(!1),m=o.common.a11y,p=async()=>{await j.signOut({fetchOptions:{onSuccess:()=>{i.navigate({to:"/"})},onError:s=>{v.error(o.auth.common.logoutFailed),console.error("sign out error:",s)}}})};return e.jsxs(x,{open:c,onOpenChange:n,children:[e.jsx(g,{"aria-label":m.userMenu,children:e.jsx(w,{name:a.name??null,image:a.image??null,className:"size-8 border"})}),e.jsxs(f,{align:"end",className:"w-64",children:[e.jsx("div",{className:"flex items-center gap-2 p-2",children:e.jsxs("div",{className:"flex flex-col space-y-1 leading-none",children:[e.jsx("p",{className:"font-medium",children:a.name}),e.jsx("p",{className:"truncate text-sm text-muted-foreground",children:a.email})]})}),e.jsx(r,{}),l.map(s=>s.href?e.jsx(h,{to:s.href,className:"block",children:e.jsxs(t,{children:[s.icon?e.jsx(s.icon,{className:"mr-2 size-4"}):null,s.title]})},s.title):null),e.jsx(r,{}),e.jsxs(t,{onClick:async s=>{s.preventDefault(),n(!1),await p()},children:[e.jsx(D,{className:"mr-2 size-4"}),o.auth.common.logout]})]})]})}export{A as UserButton};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.