PageSourceSearch

https://workait.com/assets/WorkplaceWorkerProfile-1eT6HgJe.js

js workait.com collected 2026-10-08 08:27:39 UTC 5,016 bytes, 2 lines download raw bytes

1import{fP as T,fM as g,fk as v,f_ as p,fB as B,e9 as e,bc as j,a2 as E,K as f,s as R,$ as u,aB as S,aX as I,bR as M,d4 as O,fO as $,g0 as q,es as x,cW as _}from"./index-D2yE0WFs.js";import{W as K}from"./WorkerProfileContent-iwomkxgB.js";import{u as U}from"./useWorkerProfile-CTow9ngc.js";import"./zap-DpMi3MII.js";import"./target-C8eUfaax.js";import"./compass-B9MOT94A.js";import"./users-314H31wg.js";import"./sparkles-B3QCw_Y_.js";const V=()=>{const{slug:l}=T(),o=g(),{user:c,profile:a}=v(),{worker:r,creator:n,hasHired:d,hasWorkplaceAccess:m,isLoading:w,error:W}=U(l||"",a==null?void 0:a.current_workplace_id),{t:i}=p(),h=d||m,{isHiring:N,isEmbeddedCheckoutOpen:y,clientSecret:C,checkoutSessionId:P,selectedWorker:s,hiredWorker:t,startTrial:b,handleHireSuccess:H,resetCheckoutState:L,closeHiredModal:A}=B(a==null?void 0:a.current_workplace_id,c==null?void 0:c.id),k=()=>{o("/workplace/hire")},F=()=>{r&&b({id:r.id,name:r.name,image:r.avatar_url,avatar_url:r.avatar_url,expertise:r.expertise,role:r.role,monthly_price:r.monthly_price,current_level:r.current_level,current_level_facet:r.current_level_facet},()=>{})};return w?e.jsx("div",{className:"flex-1 flex items-center justify-center min-h-screen",children:e.jsxs("div",{className:"text-center space-y-4",children:[e.jsx(j,{className:"w-12 h-12 animate-spin text-primary mx-auto"}),e.jsx("p",{className:"text-muted-foreground",children:i("workplace.marketplace.WorkplaceWorkerProfileContent.div_div_p.loading_worker_profile","Loading worker profile...")})]})}):W||!r?e.jsx("div",{className:"flex-1 flex items-center justify-center min-h-screen px-4",children:e.jsxs("div",{className:"text-center space-y-4 max-w-md",children:[e.jsx(E,{className:"w-16 h-16 text-destructive mx-auto"}),e.jsx("h1",{className:"text-2xl font-bold text-foreground",children:i("workplace.marketplace.WorkplaceWorkerProfileContent.div_div_h1.worker_not_found","Worker Not Found")}),e.jsxs("p",{className:"text-muted-foreground",children:[i("workplace.marketplace.WorkplaceWorkerProfileContent.div_div_p.we_couldn_t_find_a_worker_with_the_name",`We couldn't find a worker with the name "`),l,i("workplace.marketplace.WorkplaceWorkerProfileContent.div_div_p.please_check_the_url_and_try_again",`". 
2            Please check the URL and try again.`)]}),e.jsx(f,{onClick:k,className:"mt-6",children:"Back"})]})}):e.jsxs("div",{className:"min-h-screen flex flex-col bg-background",children:[e.jsxs("div",{className:"max-w-7xl mx-auto w-full px-4 sm:px-6 lg:px-8 py-4 flex items-center gap-4",children:[e.jsxs(f,{variant:"ghost",onClick:k,className:"gap-2",children:[e.jsx(R,{className:"w-4 h-4"}),"Back"]}),r.category_name&&e.jsxs("div",{className:"flex items-center gap-1 text-sm text-muted-foreground",children:[e.jsx("span",{className:"cursor-pointer hover:text-primary transition-colors",onClick:()=>o("/workplace/hire"),children:"All"}),e.jsx(u,{className:"w-3.5 h-3.5"}),e.jsx("span",{className:"cursor-pointer hover:text-primary transition-colors",onClick:()=>o(`/workplace/workers/category/${r.category_slug}`),children:r.category_name}),r.subcategory_name&&e.jsxs(e.Fragment,{children:[e.jsx(u,{className:"w-3.5 h-3.5"}),e.jsx("span",{className:"cursor-pointer hover:text-primary transition-colors",onClick:()=>o(`/workplace/workers/category/${r.category_slug}/${r.subcategory_slug}`),children:r.subcategory_name})]}),e.jsx(u,{className:"w-3.5 h-3.5"}),e.jsx("span",{className:"text-foreground font-medium",children:r.name})]})]}),e.jsx(K,{worker:r,creator:n||null,hasHired:h,isLoading:N,canHire:!h,onHireClick:F}),e.jsx(S,{isOpen:y,onClose:L,clientSecret:C,sessionId:P,worker:s?{id:s.id,name:s.name,image:s.image||s.avatar_url,role:s.role,monthly_price:s.monthly_price,current_level:s.current_level,current_level_facet:s.current_level_facet}:null,onHireSuccess:()=>{s&&H(s)},workplaceId:a==null?void 0:a.current_workplace_id}),e.jsx(I,{isOpen:!!t,onClose:A,worker:t?{id:t.id,name:t.name,image:t.image||t.avatar_url,expertise:t.expertise,role:t.role}:null})]})},X=()=>{$("Worker Profile");const{toast:l}=q(),o=g(),{user:c,loading:a}=v(),[r,n]=x.useState(!0),{t:d}=p();return x.useEffect(()=>{if(!a){const m=setTimeout(()=>{n(!1)},500);return()=>clearTimeout(m)}},[a]),x.useEffect(()=>{!a&&!c&&(l({title:"Authentication required",description:"Please sign in to access Workplace",variant:"destructive"}),o("/auth"))},[a,c,l,o]),a||r?e.jsxs("div",{className:"flex h-screen",children:[e.jsx(_,{}),e.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center bg-[#F9F9F9] text-gray-800",children:[e.jsx(j,{className:"h-10 w-10 text-[#5A60F1] animate-spin"}),e.jsx("h2",{className:"mt-4 text-xl font-medium",children:d("WorkplaceWorkerProfile.div_div_h2.loading_worker_profile","Loading Worker Profile...")})]})]}):e.jsxs("div",{className:"flex h-screen",children:[e.jsx(_,{}),e.jsx("div",{className:"flex-1 overflow-y-auto bg-[#F9F9F9]",children:e.jsx(V,{})})]})},re=()=>(p(),e.jsx(M,{requiredRole:"beta",children:e.jsx(O,{children:e.jsx(X,{})})}));export{re 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.