PageSourceSearch

https://knuckl.com/assets/HomeownerLeads-S20Yynm3.js

js knuckl.com collected 2026-09-24 14:47:17 UTC 5,681 bytes, 1 lines download raw bytes

1import{l as _,j as e}from"./vendor-query-BxlSJxfF.js";import{H}from"./Head-CFjoxvyt.js";import{a as P,c as B,B as w,L as N,r as R,s as M}from"./index-DO0aGFYL.js";import{H as S}from"./homeowner-trades-DdI3fK_X.js";import{t as C,a as E}from"./homeowner-i18n-BlSJu_P4.js";import{r as F}from"./lead-interest-ClOYLsIo.js";import{u as T,L as j}from"./vendor-react-DdNhUK9-.js";import{H as b}from"./house-D1lgTCJ7.js";import{S as O}from"./sparkles-B9Io74C_.js";import{M as q}from"./map-pin-Clc12hBl.js";import{L as A}from"./lock-CWPApfun.js";import"./vendor-supabase-Csx7YFID.js";import"./skill-catalog-CiwHrT6-.js";function Z(){var p,x,h,u;T();const{tr:r}=P(),{data:t,isLoading:d,fetchNextPage:y,hasNextPage:v,isFetchingNextPage:l}=_({queryKey:["homeowner-leads-feed","list"],initialPageParam:0,queryFn:async({pageParam:s})=>{const{data:a,error:n}=await M.rpc("homeowner_leads_feed",{_limit:50,_offset:s});if(n)throw n;return a},getNextPageParam:(s,a)=>{var f;const n=a.reduce((k,L)=>{var g;return k+(((g=L.leads)==null?void 0:g.length)??0)},0);if((f=s.leads)!=null&&f.length)return n<(s.total??0)?n:void 0}}),i=((x=(p=t==null?void 0:t.pages)==null?void 0:p[0])==null?void 0:x.paid)??!1,o=((t==null?void 0:t.pages)??[]).flatMap(s=>s.leads??[]),m=((u=(h=t==null?void 0:t.pages)==null?void 0:h[0])==null?void 0:u.total)??0,c=B();return e.jsxs("div",{className:"min-h-screen bg-background pb-24",children:[e.jsx(H,{title:"Homeowner projects | Knuckl",description:"Residential leads near you.",noindex:!0}),e.jsxs("header",{className:"px-5 pt-6 pb-4",children:[e.jsxs("h1",{className:"text-2xl font-bold flex items-center gap-2",children:[e.jsx(b,{className:"w-5 h-5 text-[hsl(var(--entity-homeowner))]"})," ",r("homeowner.feed.title")]}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:r("homeowner.feed.subtitle")})]}),e.jsxs("nav",{className:"px-5 pb-4 flex gap-2",children:[e.jsx("span",{className:"px-3 h-9 inline-flex items-center rounded-full bg-[hsl(var(--entity-homeowner))]/15 text-[hsl(var(--entity-homeowner))] text-sm font-semibold",children:r("external.tabs.homeowner")}),e.jsx(j,{to:"/external-leads",className:"px-3 h-9 inline-flex items-center rounded-full border border-border/60 text-sm text-muted-foreground",children:r("external.tabs.external")})]}),!i&&!d&&e.jsxs("div",{className:"mx-5 mb-5 rounded-card border border-primary/40 bg-primary/10 p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 font-medium",children:[e.jsx(O,{className:"w-4 h-4 text-primary"})," ",r("homeowner.feed.paidFeature")]}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1.5",children:r("homeowner.feed.paidBody")}),m>0&&e.jsx("p",{className:"text-sm text-primary font-medium mt-1.5",children:r("homeowner.feed.moreNearby").replace("{count}",String(m))}),e.jsx(w,{className:"mt-3 rounded-xl h-10",onClick:()=>c.open("generic",r("homeowner.feed.paidBody")),children:r("homeowner.feed.startTrial")})]}),d?e.jsx("div",{className:"grid place-items-center py-20",children:e.jsx(N,{className:"w-6 h-6 animate-spin text-muted-foreground"})}):o.length===0?e.jsx("p",{className:"px-5 text-sm text-muted-foreground",children:r("homeowner.feed.empty")}):e.jsxs("div",{className:"px-5 space-y-3",children:[o.map(s=>e.jsxs(j,{to:i?`/homeowner-leads/${s.id}`:"#",onClick:a=>{F(s.id),!i&&(a.preventDefault(),c.open("generic",r("homeowner.feed.paidBody")))},className:"block rounded-card border border-border/60 bg-card/60 p-4 hover:border-[hsl(var(--entity-homeowner))]/50 transition-colors",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 mb-1 rounded-full bg-[hsl(var(--entity-homeowner))]/15 text-[hsl(var(--entity-homeowner))] text-micro font-bold uppercase tracking-wider",children:[e.jsx(b,{className:"w-2.5 h-2.5"})," ",r("entityLabels.homeowner")]}),e.jsx("div",{className:"font-semibold truncate",children:C(r,s.trade,S)}),e.jsxs("div",{className:"text-xs text-muted-foreground mt-0.5 flex items-center gap-1",children:[e.jsx(q,{className:"w-3 h-3"}
1),[s.city,s.state].filter(Boolean).join(", ")||r("homeowner.feed.nearby"),s.distance_miles!=null&&` · ${s.distance_miles} mi`]})]}),e.jsx("span",{className:"text-caption text-muted-foreground shrink-0",children:R(s.created_at)})]}),e.jsxs("p",{className:"text-sm text-muted-foreground mt-2.5 line-clamp-2",children:[s.description,s.locked&&"…"]}),e.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-2 text-caption",children:[e.jsx("span",{className:"px-2 py-0.5 rounded-full bg-muted",children:E(r,s.timeline)}),s.budget_band&&e.jsx("span",{className:"px-2 py-0.5 rounded-full bg-muted",children:s.budget_band}),s.responded?e.jsx("span",{className:"px-2 py-0.5 rounded-full bg-primary/15 text-primary",children:r("homeowner.feed.youReplied")}):e.jsx("span",{className:"text-muted-foreground",children:s.response_count===0?r("homeowner.feed.noProsYet"):s.response_count===1?r("homeowner.feed.proReplied"):r("homeowner.feed.prosReplied",{count:s.response_count})}),s.locked&&e.jsxs("span",{className:"ml-auto flex items-center gap-1 text-primary",children:[e.jsx(A,{className:"w-3 h-3"})," ",r("homeowner.feed.proBadge")]})]})]},s.id)),e.jsx("p",{className:"text-xs text-muted-foreground text-center pt-1",children:r("homeowner.feed.showingCount").replace("{shown}",String(o.length)).replace("{total}",String(Math.max(m,o.length)))}),v&&e.jsx(w,{variant:"outline",className:"w-full rounded-xl h-11",disabled:l,onClick:()=>void y(),children:l?e.jsx(N,{className:"w-4 h-4 animate-spin"}):r("homeowner.feed.loadMore")})]})]})}export{Z 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.