1import{c as h,u as g,r as o,s as c,j as e,U as u,ao as b,d as v,a4 as j,a5 as N,a8 as m,k as y,v as w,a6 as _,a7 as k}from"./index-0UsueSAZ.js";import{P as C}from"./PageHeader-Cms0NLyG.js";import{B as S}from"./BottomNav-CRFfM7Ri.js";import{A as P}from"./AvatarReminderDialog-BtoYyJVT.js";import{B as A}from"./book-open-CWMVGrMa.js";import{R as O}from"./rotate-ccw-ZJ_m1raF.js";import"./arrow-left-BjHI3o5t.js";import"./SignupTechnician-BTrJF0Lj.js";import"./select-DOAglS8N.js";import"./index-BdQq_4o_.js";import"./validators-DePryq_z.js";import"./image-BHM5lO_u.js";const R=[{icon:A,label:"Como usar o app (tutorial)",to:"/technician/tutorial"},{icon:u,label:"Dados pessoais",to:"/technician/edit-profile"},{icon:m,label:"Documentação",to:"/technician/documents"},{icon:O,label:"Retornos de garantia",to:"/technician/returns"},{icon:y,label:"Minhas avaliações",to:"#"},{icon:w,label:"Histórico",to:"/technician/jobs"},{icon:_,label:"Configurações",to:"/technician/settings"},{icon:k,label:"Termos de uso",to:"/termos"},{icon:m,label:"PolÃtica de privacidade",to:"/privacidade"}],$=()=>{const{user:s,signOut:d}=h();g();const[a,r]=o.useState(null),[l,f]=o.useState(!1),[x,i]=o.useState(!1);o.useEffect(()=>{s&&(c.from("profiles").select("full_name, avatar_url").eq("user_id",s.id).maybeSingle().then(({data:t})=>{t&&r(t)}),c.from("technician_profiles").select("is_verified").eq("user_id",s.id).maybeSingle().then(({data:t})=>{t&&f(t.is_verified)}))},[s]);const p=()=>{d()};return e.jsxs("div",{className:"min-h-screen bg-background pb-20",children:[e.jsx(C,{title:"Perfil"}),e.jsxs("div",{className:"mx-auto max-w-lg px-6 py-6",children:[e.jsxs("div",{className:"mb-6 flex flex-col items-center",children:[e.jsxs("button",{type:"button",onClick:()=>i(!0),"aria-label":"Trocar foto de perfil",className:"group relative mb-3 flex h-20 w-20 items-center justify-center rounded-full bg-gradient-dark overflow-hidden focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2 focus:ring-offset-background",children:[a!=null&&a.avatar_url?e.jsx("img",{src:a.avatar_url,alt:"",className:"h-full w-full object-cover"}):e.jsx(u,{className:"h-8 w-8 text-primary"}),e.jsx("span",{className:"absolute inset-0 flex items-center justify-center bg-black/50 opacity-0 transition-opacity group-hover:opacity-100 group-active:opacity-100",children:e.jsx(b,{className:"h-5 w-5 text-white"})})]}),e.jsx("button",{type:"button",onClick:()=>i(!0),className:"text-xs font-medium text-muted-foreground underline-offset-2 hover:underline",children:a!=null&&a.avatar_url?"Trocar foto":"Adicionar foto"}),e.jsx("h2",{className:"mt-2 text-lg font-bold text-foreground",children:(a==null?void 0:a.full_name)||"Técnico"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s==null?void 0:s.email}),e.jsx("span",{className:`mt-1 rounded-full px-3 py-0.5 text-xs font-semibold ${l?"bg-success/15 text-success":"bg-warning/15 text-warning"}`,children:l?"Aprovado":"Pendente"})]}),e.jsx(P,{open:x,onOpenChange:i,onSaved:t=>r(n=>({full_name:(n==null?void 0:n.full_name)||"",avatar_url:t}))}),e.jsx("div",{className:"space-y-1",children:R.map(t=>e.jsxs(v,{to:t.to,className:"flex items-center gap-3 rounded-xl px-4 py-3 transition-colors hover:bg-muted",children:[e.jsx(t.icon,{className:"h-5 w-5 text-muted-foreground"}),e.jsx("span",{className:"flex-1 text-sm font-medium text-foreground",children:t.label}),e.jsx(j,{className:"h-4 w-4 text-muted-foreground"})]},t.label))}),e.jsxs("button",{onClick:p,className:"mt-6 flex w-full items-center gap-3 rounded-xl px-4 py-3 text-destructive transition-colors hover:bg-destructive/10",children:[e.jsx(N,{className:"h-5 w-5"}),e.jsx("span",{className:"text-sm font-medium",children:"Sair da conta"})]})]}),e.jsx(S,{role:"technician"})]})};export{$ as default};
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.