PageSourceSearch

https://knuckl.com/assets/PublicJobView-CU__9MdE.js

js knuckl.com collected 2026-09-24 14:47:30 UTC 8,006 bytes, 1 lines download raw bytes

1import{a as o,j as e}from"./vendor-query-BxlSJxfF.js";import{a as _,bk as R,al as D,bl as T,i as J,bm as K,bn as F,u as M,s as f,L as H,K as v}from"./index-DO0aGFYL.js";import{H as q}from"./Head-CFjoxvyt.js";import{K as N}from"./KnucklLogo-DmAzyuOm.js";import{a as z,b as V}from"./pending-shared-jobs-ByGeH9Qv.js";import{P as Y}from"./ProBadge-XhoH1wyr.js";import{g as Z,d as W,u as X,L as g}from"./vendor-react-DdNhUK9-.js";import{S as G}from"./share-2-0UyL2gfq.js";import{Z as Q}from"./zap-3WSssjod.js";import{M as ee}from"./map-pin-Clc12hBl.js";import{D as te}from"./dollar-sign-4OmuIJls.js";import{U as se}from"./users-4wDC2oQA.js";import{W as ae}from"./wrench-BXv_aUNf.js";import"./vendor-supabase-Csx7YFID.js";import"./popover-wk50W3qJ.js";import"./sparkles-B9Io74C_.js";function re({pathWithQuery:s,label:h,cta:r}){const{tr:p}=_(),i=J(),c=K()||F();return o.useEffect(()=>{if(!(i||!c))return R(s)},[i,c,s]),i||!c?null:e.jsxs("div",{className:"flex items-center gap-3 rounded-card border border-border bg-card px-4 py-3",children:[e.jsx(D,{className:"h-5 w-5 shrink-0 text-primary","aria-hidden":!0}),e.jsx("p",{className:"flex-1 text-sm text-foreground",children:h??p("openInApp.label")}),e.jsx("button",{type:"button",onClick:()=>T(s),className:"shrink-0 rounded-full bg-primary px-4 py-2 text-sm font-semibold text-primary-foreground",children:r??p("openInApp.cta")})]})}function Ne(){const{id:s}=Z(),[h]=W(),r=h.get("invite"),p=X(),{user:i,loading:c}=M(),{lang:ne,t:n}=_(),[t,k]=o.useState(null),[u,w]=o.useState(null),[S,A]=o.useState(!1),[I,$]=o.useState(!0),[P,C]=o.useState(!1);if(o.useEffect(()=>{s&&(async()=>{const{data:x}=await f.from("jobs").select("id, title, description, location, pay, pay_type, slots, filled_slots, skills, status, boosted_until, contractor_id").eq("id",s).is("deleted_at",null).maybeSingle();let a=x;if(!a){const{data:l}=await f.rpc("public_job_preview",{_job_id:s,_invite_token:r});a=Array.isArray(l)?l[0]??null:l??null}if(!a)C(!0);else{k(a);let l=null;if(a.contractor_id){const[{data:d},{data:y}]=await Promise.all([f.from("contractor_profiles_public").select("company_name, is_paid_tier").eq("user_id",a.contractor_id).maybeSingle(),f.from("profiles").select("full_name").eq("user_id",a.contractor_id).maybeSingle()]);l=(d==null?void 0:d.company_name)||(y==null?void 0:y.full_name)||null,w(l),A(!!(d!=null&&d.is_paid_tier))}z({jobId:a.id,contractorId:a.contractor_id??void 0,contractorName:l??void 0})}$(!1)})()},[s]),o.useEffect(()=>{c||i&&s&&(V({userId:i.id,jobId:s,contractorId:(t==null?void 0:t.contractor_id)??null,contractorName:u}),p(`/jobs/${s}${r?`?invite=${encodeURIComponent(r)}`:""}`,{replace:!0}))},[i,c,s,p,t,u,r]),I)return e.jsx("div",{className:"min-h-dvh flex items-center justify-center bg-background",children:e.jsx(H,{className:"w-6 h-6 animate-spin text-primary"})});if(P||!t)return e.jsxs("div",{className:"min-h-dvh flex flex-col items-center justify-center bg-background px-6 text-center",children:[e.jsx(N,{className:"h-10 w-auto mb-4"}),e.jsx("h1",{className:"text-xl font-bold text-foreground",children:n.pass2.pjvUnavailableTitle}),e.jsx("p",{className:"text-sm text-muted-foreground mt-2",children:n.pass2.pjvUnavailableBody}),e.jsx(g,{to:"/auth?mode=signup",onClick:()=>v("find_work","public_job_view_unavailable"),className:"mt-6 inline-flex min-h-[48px] items-center justify-center px-6 rounded-full bg-primary text-primary-foreground font-semibold",children:n.pass2.pjvBrowseJobs})]});const b=Math.max((t.slots??0)-(t.filled_slots??0),0),j=t.pay!=null?`$${t.pay}${t.pay_type==="daily"?"/day":t.pay_type==="fixed"?" fixed":"/hr"}`:null,m=Array.isArray(t.skills)?t.skills:[],L=!!t.boosted_until&&new Date(t.boosted_until).getTime()>Date.now(),B=u?n.pass2.pjvSharedByPrefix(u):n.pass2.pjvSharedByAnon,E=`/auth?mode=signup&redirect=${encodeURIComponent(`/jobs/${t.id}`)}`,U=`/auth?redirect=${encodeURIComponent(`/jobs/${t.id}`)}`,O={"@context":"https://schema.org","@type":"JobPosting",title:t.title,description:t.description||`${t.title} job opportunity on Knuckl`,datePosted:t.created_at??new Date().toISOString(),employmentType:["CONTRACTOR","TEMPORARY"],hiringOrganization:{"@type":"Organization",name:"Knuckl",sameAs:"https://knuckl.com",logo:"https://knuckl.com/og-image.png"},jobLocation:t.location?{"@type":"Place",address:{"@type":"PostalAddress",addressLocality:t.location,addressCountry:"US"}}:void 0,...t.pay!=null?{baseSalary:{"@type":"MonetaryAmount",currency:"USD",value:{"@type":"QuantitativeValue",value:t.pay,unitText:t.pay_type==="daily"?"DAY":t.pay_type==="fixed"?"FIXED":"HOUR"}}}:{},...Array.isArray(m)&&m.length>0?{skills:m.join(", ")}:{},directApply:!1,url:`https://knuckl.com/jobs/share/${t.id}`};return e.jsxs("div",{className:"min-h-dvh bg-background",children:[e.jsx(q,{title:`${t.title}
1 — Knuckl`,description:t.description?String(t.description).slice(0,155):`${t.title} job opportunity on Knuckl${t.location?` in ${t.location}`:""}.`,canonical:`https://knuckl.com/jobs/share/${t.id}`,jsonLd:O}),e.jsxs("header",{className:"px-5 py-4 border-b border-border flex items-center justify-between",children:[e.jsx(N,{className:"h-7 w-auto"}),e.jsx(g,{to:U,className:"text-sm font-semibold text-primary hover:underline",children:n.pass2.pjvSignIn})]}),e.jsxs("main",{className:"max-w-xl mx-auto px-5 py-8 space-y-6",children:[e.jsx(re,{pathWithQuery:`/jobs/share/${t.id}${r?`?invite=${encodeURIComponent(r)}`:""}`}),e.jsxs("div",{className:"rounded-card px-4 py-3 flex items-center gap-2 text-sm font-semibold",style:{backgroundColor:"#FFF3EE",color:"#E85D24"},children:[e.jsx(G,{className:"w-4 h-4 shrink-0"}),e.jsx("span",{className:"truncate",children:B})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs uppercase tracking-wider text-muted-foreground font-semibold mb-2",children:"Job opportunity"}),e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("h1",{className:"font-display text-3xl text-foreground tracking-tight",children:t.title}),e.jsx(Y,{size:"sm",visible:S}),L&&e.jsxs("span",{className:"inline-flex items-center gap-1 bg-primary text-primary-foreground text-micro uppercase tracking-wider font-semibold px-2 py-0.5 rounded-full shadow",children:[e.jsx(Q,{className:"w-3 h-3"})," Boosted"]})]})]}),e.jsxs("div",{className:"rounded-card border border-border bg-card/60 p-4 space-y-3",children:[t.location&&e.jsxs("div",{className:"flex items-center gap-3 text-sm text-foreground",children:[e.jsx(ee,{className:"w-4 h-4 text-primary shrink-0"}),e.jsx("span",{children:t.location})]}),j&&e.jsxs("div",{className:"flex items-center gap-3 text-sm text-foreground",children:[e.jsx(te,{className:"w-4 h-4 text-primary shrink-0"}),e.jsx("span",{className:"font-semibold",children:j})]}),b>0&&e.jsxs("div",{className:"flex items-center gap-3 text-sm text-foreground",children:[e.jsx(se,{className:"w-4 h-4 text-primary shrink-0"}),e.jsxs("span",{children:[b," spot",b===1?"":"s"," open"]})]})]}),m.length>0&&e.jsxs("div",{children:[e.jsxs("p",{className:"text-xs font-bold text-foreground mb-2 inline-flex items-center gap-1.5",children:[e.jsx(ae,{className:"w-3.5 h-3.5"})," Skills needed"]}),e.jsx("div",{className:"flex flex-wrap gap-2",children:m.map(x=>e.jsx("span",{className:"px-3 py-1 rounded-full bg-secondary text-secondary-foreground text-xs font-medium",children:x},x))})]}),t.description&&e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-bold text-foreground mb-2",children:"About this job"}),e.jsx("p",{className:"text-sm text-foreground/80 whitespace-pre-wrap leading-relaxed",children:t.description})]}),e.jsx(g,{to:E,onClick:()=>v("find_work","public_job_view_apply"),className:"w-full min-h-[56px] inline-flex items-center justify-center rounded-full bg-primary text-primary-foreground font-bold text-base shadow-lg shadow-primary/25 hover:bg-primary/90 transition-colors",children:n.pass2.pjvApplyCta}),e.jsx("p",{className:"text-caption text-muted-foreground text-center",children:n.pass2.pjvMarketplaceBlurb})]})]})}export{Ne 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.