import{W as h,a as x,q as j,j as e,b as m}from"./BulkImageUpload-DGPbX05r.js";import{A as u}from"./Authenticated-DQno4VYw.js";import{P as f}from"./PageTitle-feHaMeNG.js";import{S as c}from"./sweetalert2.all-CGGHY7K6.js";import"./bootstrap.esm-e_F80uXB.js";const w=i=>{const{delete:l}=h(),[r,n]=x.useState(i.packages),{currency:t}=j().props,d=({validity:s})=>s==0?e.jsx("span",{children:"Lifetime"}):s>=12?e.jsxs("span",{children:[s/12," Years"]}):e.jsxs("span",{children:[s," Months"]}),o=s=>()=>{c.fire({title:"Are you sure want to Delete?",icon:"warning",showCancelButton:!0,confirmButtonText:"Yes, delete!"}).then(a=>{a.isConfirmed&&l(route("package.destroy",r[s].id),{onSuccess:()=>{r.splice(s,1),n(Array.from(r)),c.fire("Deleted!","Package Removed Sucessfully","success")}})})};return e.jsxs(u,{auth:i.auth,errors:i.errors,current:i.current,children:[e.jsx(f,{title:"Manage Packages",path:"Package",pathurl:""}),e.jsx("div",{className:"row",children:r&&r.map((s,a)=>e.jsx("div",{className:"col-md-4",children:e.jsxs("div",{className:"card pricecard  rounded border-0 text-center",children:[e.jsxs("div",{className:"card-header",children:[e.jsx("h6",{className:"",children:s.name}),e.jsx("p",{children:s.desic}),e.jsxs("h4",{className:"mb-0",children:[t,parseFloat(s.price).toFixed(2)]})]}),e.jsx("div",{className:"card-body",children:e.jsxs("ul",{children:[e.jsxs("li",{children:["Total No of Listings ",e.jsxs("span",{children:[" -   ",s.listing]})]}),e.jsxs("li",{children:["Verified Badge ",e.jsxs("span",{children:[" -   ",s.verification]})]}),e.jsxs("li",{children:["Messages from Visitors ",e.jsxs("span",{children:[" -   ",s.message," "]})]}),e.jsxs("li",{children:["Accept Reviews ",e.jsxs("span",{children:[" -   ",s.review]})]}),e.jsxs("li",{children:["No of Services Allowed / Listing ",e.jsxs("span",{children:[" -   ",s.services]})]}),e.jsxs("li",{children:["No of Products Allowed / Listing ",e.jsxs("span",{children:[" -   ",s.products]})]}),e.jsxs("li",{children:["No of Images Allowed / Listing ",e.jsxs("span",{children:[" -   ",s.images]})]}),e.jsxs("li",{children:["Package Validity ",e.jsxs("span",{children:[" -   ",e.jsx(d,{validity:s.validity})]})]})]})}),e.jsx("div",{className:"card-footer text-muted",children:e.jsxs("ul",{children:[e.jsx("li",{children:e.jsxs(m,{href:route("package.edit",s.id),children:[e.jsx("i",{className:"bi bi-pencil-square"})," Edit"]})}),e.jsxs("li",{onClick:o(a),children:[e.jsx("i",{className:"bi bi-trash3"})," Delete"]})]})})]})},a))})]})};export{w as default};
