PageSourceSearch

https://www.avah.ai/assets/PublicOwnerProperties-Cwgnvgah.js

js avah.ai collected 2026-10-05 13:29:21 UTC 5,310 bytes, 8 lines download raw bytes

1import{v as P,r as k,j as e,c as b,x as $,H as q,f as F,Y as L,s as N}from"./index-BtJ-vZu_.js";import{u as w}from"./useQuery-DSrPUx2P.js";import{P as R}from"./PropertyCard-CoV8ox8H.js";import{C as S}from"./ChatBot-CQxX2QNZ.js";import{C as u}from"./card-CEWGQVNs.js";import"./chevron-left-DvtZF2Em.js";import"./chevron-right-DPm5p5_h.js";import"./pencil-CcuBa6yK.js";import"./copy-CQQAxWLn.js";import"./bed-FxE4NkCu.js";import"./bath-DiapEPYo.js";import"./square-D5FxFZq-.js";import"./circle-check-big-DivO8Ilb.js";import"./scroll-area-DQ90_rF7.js";import"./index-C1qZsUBS.js";import"./index-BdQq_4o_.js";import"./send-C6paqpX2.js";const W=()=>{var j;const{ownerId:i}=P(),[s,h]=k.useState("residential"),{data:a,isLoading:v}=w({queryKey:["owner-profile",i],queryFn:async()=>{const{data:r,error:o}=await N.from("profiles").select("full_name, company_name, email").eq("id",i).maybeSingle();if(o)throw o;return r}}),{data:t,isLoading:_}=w({queryKey:["owner-properties",i],queryFn:async()=>{const{data:r,error:o}=await N.from("properties").select(`
2          *,
3          property_images!property_images_property_id_fkey(
4            image_url,
5            is_primary,
6            display_order
7          )
8        `).eq("owner_id",i).order("created_at",{ascending:!1});if(o)throw o;return(r||[]).map(n=>{var y,f;const x=(y=n.property_images)==null?void 0:y.find(C=>C.is_primary),g=(f=n.property_images)==null?void 0:f[0];return{...n,image_url:(x==null?void 0:x.image_url)||(g==null?void 0:g.image_url)||n.image_url,category:n.category}})}});if(v||_)return e.jsx("div",{className:"min-h-screen bg-background",children:e.jsxs("div",{className:"container mx-auto px-4 py-8",children:[e.jsx(b,{className:"h-32 w-full mb-8"}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:[1,2,3].map(r=>e.jsx(b,{className:"h-96"},r))})]})});const l=(a==null?void 0:a.company_name)||(a==null?void 0:a.full_name)||"Property Owner",m=t==null?void 0:t.filter(r=>r.category===s),c=((j=t==null?void 0:t[0])==null?void 0:j.image_url)||"/placeholder.svg",d=`${l} - Properties for Rent`,p=`Browse available ${s} properties for rent from ${l}. Find your perfect rental property today.`;return e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsxs($,{children:[e.jsx("title",{children:d}),e.jsx("meta",{name:"description",content:p}),e.jsx("link",{rel:"icon",type:"image/png",href:c}),e.jsx("meta",{property:"og:type",content:"website"}),e.jsx("meta",{property:"og:title",content:d}),e.jsx("meta",{property:"og:description",content:p}),e.jsx("meta",{property:"og:image",content:c}),e.jsx("meta",{name:"twitter:card",content:"summary_large_image"}),e.jsx("meta",{name:"twitter:title",content:d}),e.jsx("meta",{name:"twitter:description",content:p}),e.jsx("meta",{name:"twitter:image",content:c})]}),e.jsx("header",{className:"bg-card py-6 border-b",children:e.jsx("div",{className:"container mx-auto px-4",children:e.jsxs("div",{className:"text-center",children:[e.jsx("h1",{className:"text-2xl font-bold text-foreground mb-1",children:l}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Available Properties for Rent"})]})})}),e.jsxs("main",{className:"container mx-auto px-4 py-8",children:[t&&t.length>0&&e.jsx("div",{className:"mb-8",children:e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 max-w-2xl mx-auto",children:[e.jsx(u,{className:`p-6 cursor-pointer transition-all hover:shadow-lg ${s==="residential"?"border-primary border-2 bg-primary/5":"border-border hover:border-primary/50"}`,onClick:()=>h("residential"),children:e.jsxs("div",{className:"flex flex-col items-center text-center gap-3",children:[e.jsx("div",{className:`h-16 w-16 rounded-full flex items-center justify-center ${s==="residential"?"bg-primary text-primary-foreground":"bg-muted"}`,children:e.jsx(q,{className:"h-8 w-8"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-semibold text-lg",children:"Residential"}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:[t.filter(r=>r.category==="residential").length," Properties"]})]})]})}),e.jsx(u,{className:`p-6 cursor-pointer transition-all hover:shadow-lg ${s==="commercial"?"border-primary border-2 bg-primary/5":"border-border hover:border-primary/50"}`,onClick:()=>h("commercial"),children:e.jsxs("div",{className:"flex flex-col items-center text-center gap-3",children:[e.jsx("div",{className:`h-16 w-16 rounded-full flex items-center justify-center ${s==="commercial"?"bg-primary text-primary-foreground":"bg-muted"}`,children:e.jsx(F,{className:"h-8 w-8"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-semibold text-lg",children:"Commercial"}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:[t.filter(r=>r.category==="commercial").length," Properties"]})]})]})})]})}),!t||t.length===0?e.jsxs(u,{className:"p-12 text-center",children:[e.jsx(L,{className:"h-16 w-16 mx-auto mb-4 text-muted-foreground"}),e.jsx("h2",{className:"text-2xl font-semibold mb-2",children:"No Properties Available"}),e.jsx("p",{className:"text-muted-foreground",children:"Check back soon for new listings."})]}):e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:m==null?void 0:m.map(r=>e.jsx(R,{property:r},r.id))})]}),e.jsx(S,{ownerId:i})]})};export{W 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.