PageSourceSearch

https://knuckl.com/assets/PublicProfile-GcKaeKoY.js

js knuckl.com collected 2026-10-02 01:34:33 UTC 6,405 bytes, 1 lines download raw bytes

1import{e as M,j as e}from"./vendor-query-CRhh6spR.js";import{a as U}from"./BusinessShowcase-BdcVtRfI.js";import{u as R,b as T,B as F,s as n}from"./index-BkVb42KZ.js";import{B as L}from"./badge-DfIFDYyU.js";import{A as W}from"./AvailabilityCalendarCard-Bykbk6KH.js";import{P as E}from"./PublicReviewsSection-B3l-xHPZ.js";import{A as G}from"./AvailabilityBadge-q70jG8vp.js";import{P as H}from"./PortfolioGrid-D0KuMW27.js";import{c as J}from"./availability-signal-B4xGzIEN.js";import{g as K,u as Q}from"./vendor-react-BAmwgVqg.js";import{M as $}from"./map-pin-BnyER353.js";import{S as z}from"./star-BpldOkBP.js";import{B as D}from"./briefcase-D-vMkZXu.js";import{U as V}from"./users-CLblnKO6.js";import{W as X}from"./wrench-CQB9vgwx.js";import{L as Y}from"./lock-BhoZ9g-C.js";import"./vendor-charts-BVeOEGzI.js";import"./vendor-stripe-2y4Jo9_W.js";import"./vendor-supabase-Csx7YFID.js";import"./use-availability-calendar-B6tu-gBc.js";import"./haptics-C4kiRWSa.js";import"./calendar-days-BR8_50Bs.js";import"./chevron-left-D_T4_riH.js";import"./chevron-right-DSioQ7mT.js";import"./chevron-down-CXoJibNt.js";import"./circle-Sm8JI_tc.js";import"./image-resize-D0CnxHUe.js";import"./image-url-_sEuZELz.js";import"./plus-CoZSqMco.js";function Be(){var b,h,w,g,j,v,N,y,_,k,P;const{userId:a}=K(),{user:o}=R(),{t:m}=T(),s=m.directory,l=Q(),{data:r,isLoading:I}=M({queryKey:["public-profile",a],enabled:!!a,queryFn:async()=>{var B,S,A,q,O;const[t,C,c]=await Promise.all([n.from("profiles_public").select("full_name,avatar_url").eq("user_id",a).maybeSingle(),n.from("worker_profiles_public").select("bio,skills,city,hourly_rate,total_jobs,years_experience,laborer_visible,availability,available_from,crew_capacity,tools_owned").eq("user_id",a).maybeSingle(),n.from("contractor_profiles_public").select("company_name,bio,specialties,city,avg_rating,total_hires,sub_visible,hiring_visible").eq("user_id",a).maybeSingle()]);return{name:((B=t.data)==null?void 0:B.full_name)??null,avatar:((S=t.data)==null?void 0:S.avatar_url)??null,worker:(A=C.data)!=null&&A.laborer_visible?C.data:null,contractor:(q=c.data)!=null&&q.sub_visible||(O=c.data)!=null&&O.hiring_visible?c.data:null}}});if(I)return e.jsx("div",{className:"p-6 text-sm text-muted-foreground",children:s.loading});if(!(r!=null&&r.name))return e.jsx("div",{className:"p-6 text-sm text-muted-foreground",children:s.publicNotFound});const d=[...((b=r.worker)==null?void 0:b.skills)??[],...((h=r.contractor)==null?void 0:h.specialties)??[]].slice(0,8),u=((w=r.worker)==null?void 0:w.city)??((g=r.contractor)==null?void 0:g.city)??null,p=((j=r.contractor)==null?void 0:j.bio)??((v=r.worker)==null?void 0:v.bio)??null,i=m.storefront??{},x=J(Number(((N=r.worker)==null?void 0:N.crew_capacity)??1)),f=(((y=r.worker)==null?void 0:y.tools_owned)??[]).slice(0,12);return e.jsxs("div",{className:"mx-auto w-full max-w-2xl p-4 pb-28 space-y-4",children:[e.jsxs("div",{className:"rounded-card border border-border/60 bg-card p-5",children:[e.jsxs("div",{className:"flex items-start gap-4",children:[e.jsx("div",{className:"w-16 h-16 rounded-full bg-muted overflow-hidden shrink-0",children:r.avatar?e.jsx("img",{src:r.avatar,alt:r.name,className:"w-full h-full object-cover"}):null}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("h1",{className:"text-xl font-bold truncate",children:r.name}),((_=r.contractor)==null?void 0:_.company_name)&&e.jsx("p",{className:"text-sm text-muted-foreground truncate",children:r.contractor.company_name}),u&&e.jsxs("p",{className:"text-xs text-muted-foreground flex items-center gap-1 mt-1",children:[e.jsx($,{className:"w-3 h-3"})," ",u]}),e.jsxs("div",{className:"flex items-center gap-3 mt-2 text-xs text-muted-foreground",children:[((k=r.contractor)==null?void 0:k.avg_rating)!=null&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(z,{className:"w-3 h-3 fill-current"}),Number(r.contractor.avg_rating).toFixed(1)]}),((P=r.worker)==null?void 0:P.total_jobs)!=null&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(D,{className:"w-3 h-3"}),r.worker.total_jobs]})]})]})]}),p&&e.jsx("p",{className:"text-sm mt-4 whitespace-pre-line",children:p}),r.worker&&e.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:[e.jsx(G,{availability:r.worker.availability??null,availableFrom
1:r.worker.available_from??null}),x>1&&e.jsxs(L,{variant:"outline",className:"rounded-full gap-1",children:[e.jsx(V,{className:"w-3 h-3"}),(i.crewBadge??"Crew of {count}").replace("{count}",String(x))]})]}),d.length>0&&e.jsx("div",{className:"flex flex-wrap gap-1.5 mt-4",children:d.map(t=>e.jsx(L,{variant:"secondary",className:"rounded-full",children:t},t))})]}),a&&r.worker&&e.jsx(U,{userId:a}),r.worker&&f.length>0&&e.jsxs("div",{className:"rounded-card border border-border/60 bg-card/60 p-4 space-y-2",children:[e.jsx("p",{className:"text-xs uppercase tracking-wider text-muted-foreground font-medium",children:i.toolsTitle}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:f.map(t=>e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-secondary/60 border border-border/60 px-2.5 h-7 text-xs",children:[e.jsx(X,{className:"w-3 h-3 text-muted-foreground"}),t]},t))})]}),a&&r.worker&&e.jsxs("div",{className:"rounded-card border border-border/60 bg-card/60 p-4 space-y-2",children:[e.jsx("p",{className:"text-xs uppercase tracking-wider text-muted-foreground font-medium",children:i.workTitle}),e.jsx(H,{profileUserId:a,role:"worker",isOwnProfile:!1})]}),a&&e.jsx(W,{userId:a,editable:!1}),a&&e.jsx(E,{userId:a}),e.jsxs("div",{className:"rounded-card border border-border/60 bg-card/60 p-4 space-y-3",children:[e.jsxs("p",{className:"text-sm text-muted-foreground flex items-start gap-2",children:[e.jsx(Y,{className:"w-4 h-4 mt-0.5 shrink-0"}),s.publicContactHint]}),e.jsx(F,{className:"w-full h-11 rounded-xl",onClick:()=>l(o?`/profile/${a}`:"/auth"),children:o?s.publicOpenInApp:s.browseJoin}),!o&&e.jsx(F,{variant:"outline",className:"w-full h-11 rounded-xl",onClick:()=>l("/browse"),children:s.publicBrowseMore}),!o&&e.jsxs("div",{className:"pt-1 text-center",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:s.publicOwnProfile}),e.jsx("button",{type:"button",onClick:()=>l("/worker-signup"),className:"mt-1 text-sm font-semibold text-primary underline underline-offset-4",children:s.publicOwnProfileCta})]})]})]})}export{Be 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.