PageSourceSearch

https://velaflow.com/_next/static/chunks/pages/marketplace/my-listings-eaeb51e92a91b0bd.js

js velaflow.com collected 2026-09-24 13:02:44 UTC 6,297 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4392],{3605:(e,l,t)=>{"use strict";t.r(l),t.d(l,{__N_SSP:()=>v,default:()=>j});var s=t(37876),n=t(14232),r=t(54587),a=t.n(r),i=t(96145),c=t(12128),d=t(10841),o=t.n(d),u=t(15234);let x=e=>{let{showAlertModal:l,onCloseAlertModal:t,selectedList:n,handleRemoveList:r,isLoading:a}=e;return(0,s.jsx)(u.A,{isOpen:l,onClose:t,children:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"flex flex-col mt-6",children:[(0,s.jsx)(i.DZ,{className:"font-bold text-[20px]",type:"h2",text:"Are you sure?"}),(0,s.jsxs)("p",{className:"text-14 text-black",children:["This will delete ","“".concat(null==n?void 0:n.title,"”")," from your listing. You can add it back later."]})]}),(0,s.jsxs)("div",{className:"mt-4 flex justify-end",children:[(0,s.jsx)(i.$n,{className:"bg-grey text-14 px-5 py-2 rounded-[5px]",onClick:t,children:"Cancel"}),(0,s.jsx)(i.$n,{disabled:a,className:"ml-3 bg-red text-14 px-5 py-2 rounded-[5px] text-white",onClick:r,children:a?(0,s.jsx)("div",{className:"flex justify-center",children:(0,s.jsx)(i.aH,{})}):"Delete"})]})]})})};var m=t(81220),f=t(97685);let h=e=>{let{listingsData:l}
1=e,[t,r]=(0,n.useState)(l||[]),[d,u]=(0,n.useState)((null==l?void 0:l.length)||0),[h,p]=(0,n.useState)(!1),[g,v]=(0,n.useState)(!1),[j,N]=(0,n.useState)(!0),y=(0,n.useRef)(null),[w,b]=(0,n.useState)(!1),[k,_]=(0,n.useState)({}),[C,S]=(0,n.useState)(!1),A=(0,n.useCallback)(async()=>{p(!0);try{var e;let l=new FormData;l.append("limit",10),l.append("offset",d);let t=await (0,m.RW)(l),s=(null==t||null==(e=t.content)?void 0:e.data)||[];s.length>0?(r(e=>[...e,...s]),u(e=>e+10),N(10===s.length)):N(!1)}catch(e){console.error("Error loading listings",e)}finally{p(!1)}},[d]);(0,n.useEffect)(()=>{if(!j||h)return;let e=new IntersectionObserver(l=>{l[0].isIntersecting&&(A(),e.disconnect())}),l=y.current;return l&&e.observe(l),()=>l&&e.unobserve(l)},[A,h,j]),(0,n.useEffect)(()=>{if(!j&&!h){v(!0);let e=setTimeout(()=>v(!1),3e3);return()=>clearTimeout(e)}},[j,h]);let D=async()=>{var e,l,s,n,a;S(!0);try{let n=await (0,m.Nf)(null==k?void 0:k.id);(null==n?void 0:n.error)?(S(!1),f.Ay.error(null==n||null==(s=n.message)||null==(l=s.response)||null==(e=l.data)?void 0:e.message)):(r(t.filter(e=>e.id!==(null==k?void 0:k.id))),b(!1),_({}),S(!1),f.Ay.success(null==n?void 0:n.message))}catch(e){console.error(e),S(!1),f.Ay.error(null==e||null==(a=e.response)||null==(n=a.data)?void 0:n.message)}};return(0,s.jsxs)("div",{className:"w-full min-h-screen bg-[#f5f5f5] py-6 px-4 sm:px-6 lg:px-8",children:[(0,s.jsxs)("div",{className:"max-w-6xl mx-auto",children:[(0,s.jsxs)("div",{className:"mb-6",children:[(0,s.jsx)(i.DZ,{type:"h1",className:"text-[16px] font-normal text-black mb-4",children:"My listing"}),(0,s.jsx)("div",{className:"h-px bg-grey w-full"})]}),(0,s.jsxs)("div",{className:"space-y-4",children:[t&&(null==t?void 0:t.length)>0?null==t?void 0:t.map(e=>{let l=(e=>{var l;if(!e||0===e.length)return"/images/marketPlaceCar.png";let t=e.find(e=>(null==e?void 0:e.is_primary)===1);return(null==t?void 0:t.url)||(null==(l=e[0])?void 0:l.url)||"/images/marketPlaceCar.png"})(null==e?void 0:e.photos),t=(e=>{if(!e)return"";let l=o()(),t=o()(e),s=l.diff(t,"minutes");if(s<1)return"just now";if(s<60)return"".concat(s,"m ago");let n=l.diff(t,"hours");if(n<24)return"".concat(n,"h ago");let r=l.diff(t,"days");return r<7?"".concat(r,"d ago"):t.format("MMM D, YYYY")})((null==e?void 0:e.updated_at)||(null==e?void 0:e.created_at));return(0,s.jsxs)(i.N_,{href:"/marketplace/listing/".concat(null==e?void 0:e.id),className:"rounded-lg p-4 sm:px-5 sm:py-1 flex flex-col sm:flex-row items-start sm:items-center gap-4 sm:gap-6",children:[(0,s.jsx)("div",{className:"relative w-full sm:w-32 h-48 sm:h-32 rounded-lg overflow-hidden bg-gray-100",children:(0,s.jsx)(a(),{width:300,height:300,src:l,alt:(null==e?void 0:e.title)||"Listing",fill:!0,className:"object-cover"})}),(0,s.jsxs)("div",{className:"flex-1 min-w-0 space-y-1",children:[(0,s.jsx)("p",{className:"text-12 text-grey",children:t}),(0,s.jsx)(i.DZ,{type:"h3",className:"text-[16px] font-normal text-black",children:null==e?void 0:e.title}),(0,s.jsxs)("p",{className:"text-[16px] font-medium text-black",children:["₹",(0,c.m)(null==e?void 0:e.price)]}),(0,s.jsx)("p",{className:"text-12 text-grey",children:null==e?void 0:e.address})]}),(0,s.jsxs)("div",{className:"flex flex-row gap-3 w-full sm:w-auto sm:flex-shrink-0",children:[(0,s.jsx)(i.N_,{href:"/marketplace/edit-listing/".concat(null==e?void 0:e.id),className:"px-10 py-1 items-center flex bg-white border border-grey text-black rounded-lg font-medium hover:bg-gray-50 transition-colors text-12",children:"Edit"}),(0,s.jsx)(i.$n,{onClick:l=>((e,l)=>{e.preventDefault(),e.stopPropagation(),_(l),b(!0)})(l,e),className:"px-5 sm:px-6 py-2.5 sm:py-3 bg-red text-white rounded-lg font-medium hover:bg-[#d32f2f] transition-colors text-12",children:"Delete"})]})]},null==e?void 0:e.id)}):(0,s.jsx)("div",{className:"bg-white rounded-lg p-8 text-center",children:(0,s.jsx)("p",{className:"text-grey text-lg",children:"No listings found"})}),h&&(0,s.jsx)("div",{className:"flex justify-center py-4",children:(0,s.jsx)(i.aH,{className:"text-black"})}),j&&(0,s.jsx)("div",{ref:y,className:"h-10"}),g&&(null==t?void 0:t.length)>0&&(0,s.jsx)("p",{className:"text-center text-gray-400 text-sm py-4",children:"You’ve reached the end!"})]})]}),(0,s.jsx)(x,{showAlertModal:w,selectedList:k,onCloseAlertModal:()=>{_({}),b(!1)},handleRemoveList:D,isLoading:C})]})};var p=t(23555),g=t(80612),v=!0;function j(e){let{userDetails:l,listingData:t}=e;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(g.A,{title:"Marketplace"}),(0,s.jsx)(p.A,{userDetails:l,hideRightSection:!0,children:(0,s.jsx)(h,{listingsData:t})})]})}},12128:(e,l,t)=>{"use strict";function s(e){return e||0===e?new Intl.NumberFormat("en-IN").format(e):""}t.d(l,{m:()=>s})},80612:(e,l,t)=>{"use strict";t.d(l,{A:()=>a});var s=t(37876),n=t(77328),r=t.n(n);function a(e){let{title:l}=e;return(0,s.jsx)(r(),{children:(0,s.jsx)("title",{children:l?"".concat(l," | Velaflow"):"Velaflow"})})}},92485:(e,l,t)=>
1{(window.__NEXT_P=window.__NEXT_P||[]).push(["/marketplace/my-listings",function(){return t(3605)}])}},e=>{e.O(0,[3716,9634,3555,636,6593,8792],()=>e(e.s=92485)),_N_E=e.O()}]);

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.