%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/opti/public_html/startup-life/assets/
Upload File :
Create Path :
Current File : /home/opti/public_html/startup-life/assets/all-adverts-a3727e95.js

import{e as d,u as x,r as m,j as e,C as p}from"./index-5492fbe1.js";import{D as u}from"./dashboard-page-layout-2cec2413.js";import{u as f}from"./useQuery-0abbcf43.js";import{C as o}from"./index-2c4b8b3c.js";import"./motion-4a110d9b.js";import"./Box-263f925f.js";const h=({start:a,end:t,text:s})=>(s==null?void 0:s.length)<t?s:`${s??"".substring(a,t)}...`,g=()=>f({queryFn:async()=>{var s;try{return(await d.get("/advert",{params:{status:"ACTIVE"}})).data}catch(r){return(s=r.response)==null?void 0:s.data}},queryKey:["get_all_active_adverts"]}),w=()=>{const{data:a,isLoading:t,isError:s}=g(),r=a==null?void 0:a.data,n=x();console.log("all",r);const i=m.useMemo(()=>!r||r.length===0?[]:r.filter(l=>l.status==="ACTIVE"),[r]);return e.jsx(u,{children:e.jsxs("section",{className:"px-5",children:[e.jsx("header",{className:"font-semibold text-[#537473]",children:"Explore different ads"}),e.jsx(o,{appear:t,children:e.jsx(p,{})}),e.jsx(o,{appear:s,children:"ERR: INTERNET_CONNECTION_REFUSED"}),e.jsx(o,{appear:!t&&!s&&i.length===0,children:e.jsx("div",{className:"font-[600] text-[#537473] mt-[20px]",children:"No active advert yet"})}),e.jsx(o,{appear:!t&&!s&&r.length>0,children:e.jsx("div",{className:"grid grid-cols-5 !mt-10 !gap-x-5 !gap-y-10",children:i==null?void 0:i.map(l=>e.jsx("div",{className:"cursor-pointer",onClick:()=>n(`/advert/${l.id}`),children:e.jsx(j,{...l})},l.id))})})]})})},j=({description:a,locations:t,title:s,demographics:r,banner:n,type:i,budget:l})=>e.jsxs("figure",{className:"max-w-[250px] !w-full bg-white rounded-[8px] overflow-hidden !pb-5 h-full flex flex-col",children:[e.jsx("div",{className:"h-[100px] w-full",children:e.jsx("img",{src:n,className:"w-full h-full object-cover",alt:"service-img"})}),e.jsxs("figcaption",{className:"!px-2 flex-1  flex flex-col pb-4",children:[e.jsx("div",{className:"!my-2 ",children:e.jsx("p",{className:"text-sm font-semibold flex-1",children:i})}),e.jsx("p",{className:"text-sm font-semibold flex-1",children:s}),t.map(c=>{}),r.map(c=>{}),e.jsx("p",{className:"text-xs !mt-1",children:h({text:a,start:0,end:20})}),e.jsxs("p",{className:"font-semibold text-sm !my-2",children:["N",l.toLocaleString()]}),e.jsx("div",{className:"flex justify-end gap-x-3 mt-auto flex-1  items-end",children:e.jsx("button",{className:"!bg-primary text-xs w-full text-white",children:"View More"})})]})]});export{w as default};

Zerion Mini Shell 1.0