PageSourceSearch

https://apifyintel.com/js/OpportunitiesPage.tsx-Bm8tz9Zw.js

js apifyintel.com collected 2026-10-07 18:54:49 UTC 10,719 bytes, 1 lines download raw bytes

1var O=Object.defineProperty;var P=Object.getOwnPropertySymbols;var D=Object.prototype.hasOwnProperty,L=Object.prototype.propertyIsEnumerable;var S=(s,a,n)=>a in s?O(s,a,{enumerable:!0,configurable:!0,writable:!0,value:n}):s[a]=n,U=(s,a)=>{for(var n in a||(a={}))D.call(a,n)&&S(s,n,a[n]);if(P)for(var n of P(a))L.call(a,n)&&S(s,n,a[n]);return s};var k=(s,a,n)=>new Promise((i,m)=>{var c=d=>{try{l(n.next(d))}catch(x){m(x)}},o=d=>{try{l(n.throw(d))}catch(x){m(x)}},l=d=>d.done?i(d.value):Promise.resolve(d.value).then(c,o);l((n=n.apply(s,a)).next())});import{u as M,b as e,ar as C,I as T,ad as q,e as z,q as B,p as H,G as _,J as Q,z as G,N as J,s as K}from"./chunk-Ch-m6dyf.js";import{j as V,r as f,L as R}from"./chunk-DeLKhPj_.js";import{j as W,S as Y,H as X,P as Z,g as ee}from"../assets/index-DpuGl9xn.js";import{b as se}from"./chunk-CFpNjax9.js";import{f as p,B as ae,a as j}from"./chunk-DWj8Tqe1.js";import{P as $}from"./chunk-DgG6mQED.js";import"./chunk-B4PXiFRX.js";import"./chunk-O-PMOEu3.js";const te=()=>typeof window!="undefined"?window.location.origin:"http://localhost:3001",ne=s=>{const{page:a,category:n,search:i,minUsers:m}=s;return M({queryKey:["opportunities",a,n,i,m],queryFn:()=>k(null,null,function*(){const c=new URLSearchParams({page:String(a),minUsers:String(m)});n&&c.set("category",n),i&&c.set("search",i);const o=yield fetch(`${te()}/api/opportunities?${c}`);if(!o.ok)throw new Error(`API error: ${o.status}`);const l=yield o.json();if(!l.success)throw new Error(l.error||"Invalid API response");return l}),staleTime:1440*60*1e3,gcTime:3600*1e3,placeholderData:c=>c,retry:1})},re={high:"bg-[#F86607] text-white border-[#F86607]",moderate:"bg-amber-50 text-amber-700 border-amber-200",low:"bg-slate-100 text-slate-600 border-slate-200"},le=[10,25,50,100,250],ie=s=>s.replace(/_/g," ").toLowerCase().replace(/\b\w/g,a=>a.toUpperCase()),oe=({actor:s})=>{const a=s.opportunity;return e.jsx("div",{className:"p-4 border-b border-slate-100 last:border-0 hover:bg-slate-50/70 transition-colors",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(ae,{src:s.pictureUrl,name:s.title||s.name,size:44}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx(R,{to:se(s),className:"font-semibold text-slate-900 hover:text-[#F86607] transition-colors line-clamp-2",children:s.title||s.name}),e.jsxs(R,{to:`/builders/${encodeURIComponent(s.username)}`,className:"block text-xs text-slate-500 hover:text-[#366DFF] hover:underline",children:["@",s.username]})]}),e.jsxs("div",{className:"flex flex-shrink-0 items-center gap-2",children:[e.jsx("span",{className:"text-2xl font-bold text-slate-900 tabular-nums leading-none",children:a.score}),e.jsx("span",{className:`rounded-full border px-2 py-0.5 text-[11px] font-semibold capitalize ${re[a.band]}`,children:a.band})]})]}),e.jsxs("div",{className:"flex h-1.5 mt-2 rounded-full overflow-hidden bg-slate-100",title:`Execution ${a.breakdown.execution} · Quality ${a.breakdown.quality} · Maintenance ${a.breakdown.maintenance}`,children:[e.jsx("div",{className:"bg-red-500",style:{width:`${a.breakdown.execution}%`}}),e.jsx("div",{className:"bg-amber-400",style:{width:`${a.breakdown.quality}%`}}),e.jsx("div",{className:"bg-slate-400",style:{width:`${a.breakdown.maintenance}%`}})]}),e.jsx("p",{className:"mt-2 text-sm text-slate-600",children:a.reasons.join(" · ")}),e.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1 mt-2 text-xs text-slate-500 tabular-nums",children:[e.jsxs("span",{className:"font-semibold text-slate-700",children:[j(s.monthlyUsers)," users/m"]}),e.jsxs("span",{children:[j(s.totalRuns30d)," runs/m"]}),s.runsPerUser!==null&&s.runsPerUser>=50&&e.jsxs("span",{className:"text-[#366DFF] font-medium",children:[j(s.runsPerUser)," runs/user"]}),s.estMonthlyRevenue!==null&&s.estMonthlyRevenue>0&&e.jsxs("span",{className:"text-[#12863C] font-medium",children:["~$",j(s.estMonthlyRevenue),"/mo est."]}),s.successRate!==null&&e.jsxs("span",{className:`inline-flex items-center gap-1 ${s.successRate<80?"text-red-600 font-medium":""}`,children:[e.jsx(G,{className:"w-3 h-3"}),Math.round(s.successRate),"% success"]}),s.reviewCount>0&&s.reviewRating!==null?e.jsxs("span",{className:"inline-flex items-center gap-0.5",children:[e.jsx(J,{className:"w-3 h-3 text-amber-400 fill-amber-400"}),s.reviewRating.toFixed(1)," (",s.reviewCount,")"]}):e.jsx("span",{className:"text-slate-400",children:"No reviews"}),s.monthsSinceUpdate!==null&&e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(K,{className:"w-3 h-3"}),s.monthsSinceUpdate<1?"updated this month":`${Math.round(s.monthsSinceUpdate)}mo since update`]})]})]})]})})},fe=()=>{var v,y;const s=W(),[a,n]=V(),i=Math.max(1,parseInt(a.get("page")||"1",10)||1),m=a.get("category")||"",c=parseInt(a.get("minUsers")||"50",10)||50,o=a.get("search")||"",[l,d]=f.useState(o),[x,A]=f.useState(()=>typeof window!="undefined"&&window.matchMedia("(min-width: 640px)").matches);f.useEffect(()=>d(o),[o]),f.useEffect(()=>{if(l===o)return;const t=setTimeout(()=>{n(h=>{const u=new URLSearchParams(h);return l?u.set("search",l):u.delete("search"),u.delete("page"),u},{replace:!0})},350);return()=>clearTimeout(t)},[l,o,n]);const{data:r,isLoading:F,isError:E,isPlaceholderData:I}=ne({page:i,category:m,search:o,minUsers:c}),g=(t,h)=>{n(u=>{const b=new URLSearchParams(u);return h===null||h===""?b.delete(t):b.set(t,h),t!=="page"&&b.delete("page"),b})},N=(v=r==null?void 0:r.data)!=null?v:[],w=(y=r==null?void 0:r.totalPages)!=null?y:1;return e.jsxs("div",{className:"min-h-screen bg-slate-50",children:[e.jsx(Y,U({},s)),e.jsx(X,{}),e.jsxs("div",{className:"max-w-5xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:[e.jsx(Z,{icon:C,title:"Actor Opportunity Report",children:"Actors with proven demand that the current owner is serving badly — failing runs, poor ratings, or abandoned maintenance. Ranked to help you decide what to build next."}),e.jsxs("div",{className:"bg-blue-50 border border-blue-200 rounded-2xl p-4 mb-6 flex gap-3",children:[e.jsx(T,{className:"w-5 h-5 text-[#366DFF] flex-shrink-0 mt-0.5"}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("button",{onClick:()=>A(t=>!t),"aria-expanded":x,className:"sm:hidden flex w-full items-center justify-between gap-2 text-left text-sm font-semibold text-slate-700",children:["How the score works",x?e.jsx(q,{size:16,className:"text-slate-500"}):e.jsx(z,{size:16,className:"text-slate-500"})]}),e.jsxs("div",{className:`text-sm text-slate-700 ${x?"mt-2 sm:mt-0":"hidden"}`,children:[e.jsx("span",{className:"font-semibold",children:"Score = demand × how badly it's served."})," ","An actor with no weaknesses scores 0 no matter how popular it is. Weaknesses are weighted: failing runs (45%), poor or absent reviews (35%), stale maintenance (20%).",e.jsx("br",{}),e.jsx("span",{className:"font-semibold",children:"Demand is the strongest of three signals"})," — users, monthly runs, or estimated revenue — because a small user count often just means a 
1small, well-paying market. An 8-user scraper doing 590k runs a month, or a 13-user actor on a $500 plan, is real demand. Volume and revenue only count with at least"," ",5," distinct users behind them, so one client's private pipeline doesn't read as a market. Estimates only, not financial advice."]})]})]}),e.jsxs(ee,{className:"space-y-4",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row gap-4",children:[e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"text-xs font-semibold uppercase tracking-wide text-slate-500 mb-2",children:["Demand floor"," ",e.jsx("span",{className:"normal-case font-normal text-slate-400",children:"(any one axis)"})]}),e.jsx($,{"aria-label":"Demand floor",options:le.map(t=>({value:String(t),label:`${t}+`})),value:String(c),onChange:t=>g("minUsers",t)})]}),e.jsxs("div",{className:"sm:w-64",children:[e.jsx("div",{className:"text-xs font-semibold uppercase tracking-wide text-slate-500 mb-2",children:"Search"}),e.jsxs("div",{className:"relative",children:[e.jsx(B,{className:"w-4 h-4 text-slate-400 absolute left-3 top-1/2 -translate-y-1/2"}),e.jsx("input",{type:"text",value:l,onChange:t=>d(t.target.value),placeholder:"Actor or builder",className:"w-full pl-9 pr-3 py-2 rounded-lg border border-slate-200 text-sm focus:outline-none focus:ring-2 focus:ring-[#F86607]/30 focus:border-[#F86607]"})]})]})]}),r&&r.categories.length>0&&e.jsxs("div",{children:[e.jsx("div",{className:"text-xs font-semibold uppercase tracking-wide text-slate-500 mb-2",children:"Category"}),e.jsx($,{"aria-label":"Category",options:[{value:"",label:"All"},...r.categories.slice(0,10).map(t=>({value:t.name,label:ie(t.name),hint:t.count}))],value:m,onChange:t=>g("category",t||null)})]})]}),r&&e.jsxs("p",{className:"text-sm text-slate-500 mb-3 tabular-nums",children:[p(r.matched)," actor",r.matched===1?"":"s"," match",r.matched===1?"es":""," · ",p(r.candidatePool)," cleared the demand floor (",r.minUsers,"+ users, ",p(r.minUsers*20),"+ runs/mo, or ~$",p(r.minUsers*4),"+/mo revenue)"]}),e.jsx("div",{className:"bg-white rounded-2xl border border-slate-200 overflow-hidden",children:E?e.jsxs("div",{className:"py-16 text-center",children:[e.jsx(H,{className:"w-10 h-10 text-slate-300 mx-auto mb-3"}),e.jsx("p",{className:"text-slate-600",children:"Unable to load the opportunity report."})]}):F?e.jsx("div",{className:"p-4 space-y-3",children:Array.from({length:8}).map((t,h)=>e.jsx("div",{className:"h-20 bg-slate-100 rounded-lg animate-pulse"},h))}):N.length===0?e.jsxs("div",{className:"py-16 text-center",children:[e.jsx(C,{className:"w-10 h-10 text-slate-300 mx-auto mb-3"}),e.jsx("p",{className:"text-slate-600",children:"No actors match these filters at this demand floor."})]}):e.jsx("div",{className:I?"opacity-60 transition-opacity":"",children:N.map(t=>e.jsx(oe,{actor:t},t.id))})}),w>1&&e.jsxs("div",{className:"flex items-center justify-center gap-3 mt-6",children:[e.jsx("button",{onClick:()=>g("page",String(i-1)),disabled:i<=1,className:"p-2 rounded-lg border border-slate-200 bg-white text-slate-600 disabled:opacity-40 disabled:cursor-not-allowed hover:bg-slate-50","aria-label":"Previous page",children:e.jsx(_,{className:"w-4 h-4"})}),e.jsxs("span",{className:"text-sm text-slate-600 tabular-nums",children:["Page ",i," of ",p(w)]}),e.jsx("button",{onClick:()=>g("page",String(i+1)),disabled:i>=w,className:"p-2 rounded-lg border border-slate-200 bg-white text-slate-600 disabled:opacity-40 disabled:cursor-not-allowed hover:bg-slate-50","aria-label":"Next page",children:e.jsx(Q,{className:"w-4 h-4"})})]})]})]})};export{fe 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.