import{a,j as e,y as h}from"./BulkImageUpload-DGPbX05r.js";import{U as x}from"./User-DMCQU0ZG.js";import{U as f}from"./UserMenu-BCHgG7Y0.js";import j from"./Path-BGQq4Hlj.js";import n from"./InfoCard-CEKE0Ajm.js";import v from"./ListCard-D4AnmU-5.js";import{S as l}from"./sweetalert2.all-CGGHY7K6.js";import"./bootstrap.esm-e_F80uXB.js";const R=s=>{const[c,g]=a.useState(s.auth.user.id),[i,o]=a.useState(s.listing),d=t=>{l.fire({title:"Are you sure want to Delete?",icon:"warning",showCancelButton:!0,confirmButtonText:"Yes, delete!"}).then(r=>{r.isConfirmed&&h.delete(route("listing.destroy",t),{onSuccess:()=>{o(m=>m.filter(u=>u.id!=t)),l.fire("Deleted!","Listing Removed Successfully","success")},preserveState:!0})})};return e.jsxs(x,{children:[e.jsx(j,{title:"Dashboard"}),e.jsx("div",{className:"container-fluid user-container",children:e.jsx("div",{className:"container",children:e.jsxs("div",{className:"row",children:[e.jsx("div",{className:"col-md-3",children:e.jsx(f,{user:s.auth.user})}),e.jsxs("div",{className:"col-md-9",children:[e.jsx("div",{className:"user-info",children:e.jsxs("div",{className:"row",children:[e.jsx(n,{icon:"bi-card-checklist",count:s.count.listing,title:"Total Active Listing"}),e.jsx(n,{icon:"bi-star-half",count:s.count.review,title:"Total Reviews"}),e.jsx(n,{icon:"bi-chat-left-text",count:s.count.message,title:" Message Received"})]})}),e.jsx("div",{className:"list-title",children:e.jsx("h4",{className:"mb-0 pb-0 pt-3 mt-1 fs-6",children:"Recent Listings"})}),e.jsxs("div",{className:"latest-reviews business-listing",children:[i&&i.map((t,r)=>e.jsx(v,{uid:c,list:t,removeListing:d},r)),i.length>=2&&e.jsx("div",{className:"view-more-btn text-end",children:e.jsx("a",{href:route("my-listing"),children:e.jsx("button",{type:"button",className:"btn btn-sm btn-outline-primary",children:"View All Listings"})})})]})]})]})})})]})};export{R as default};
