import{a,j as e,y as j}from"./BulkImageUpload-DGPbX05r.js";import{A as u}from"./Authenticated-DQno4VYw.js";import{P as N}from"./PageTitle-feHaMeNG.js";import{P as f}from"./Panel-CCKAj23D.js";import{P as b}from"./Pagination-C_2iCAT4.js";import{S as i}from"./sweetalert2.all-CGGHY7K6.js";import"./bootstrap.esm-e_F80uXB.js";const U=t=>{const[n,l]=a.useState(t.users.data),[c,g]=a.useState(t.users.links),[d,m]=a.useState("");a.useEffect(()=>{t.users.links&&t.users.links.map(s=>{s.active&&m(parseInt(s.label))})},[t.users]);const o=s=>()=>{i.fire({title:"Are you sure want to Restore?",icon:"warning",showCancelButton:!0,confirmButtonText:"Yes, Restore!"}).then(r=>{r.isConfirmed&&j.delete(route("restore-user",s),{onSuccess:()=>{l(h=>h.filter(x=>x.id!=s)),i.fire("Restored!","User Restored Successfully","success")},preserveState:!0})})};return e.jsxs(u,{auth:t.auth,errors:t.errors,current:t.current,children:[e.jsx(N,{title:"View Trashed Users",path:"Trashed",pathurl:""}),e.jsxs(f,{title:"Manage Trashed Users",md:"12",children:[e.jsx("div",{className:"table-responsive-md",children:e.jsx("table",{className:"table table-responsive mb-0",children:e.jsxs("tbody",{children:[e.jsxs("tr",{children:[e.jsx("th",{className:"slno text-center",children:"#"}),e.jsx("th",{children:"Image"}),e.jsx("th",{children:"User Name"}),e.jsx("th",{children:"Email Address"}),e.jsx("th",{className:"text-center",children:"Mobile Number"}),e.jsx("th",{className:"center",children:"Active Plan"}),e.jsx("th",{className:"text-center",children:"Action"})]}),n&&n.map((s,r)=>e.jsxs("tr",{children:[e.jsx("td",{className:"text-center",children:r+d*t.users.per_page-1}),e.jsx("td",{children:e.jsx("img",{className:"rounded",style:{width:"40px"},src:"./../../assets/admin/images/person.jpg",alt:""})}),e.jsx("td",{children:s.name}),e.jsx("td",{children:s.email}),e.jsx("td",{className:"text-center",children:s.mobile}),e.jsx("td",{className:"text-center",children:s.plan}),e.jsx("td",{className:"text-center",children:e.jsxs("button",{onClick:o(s.id),className:"btn btn-primary me-2 btn-xs",children:[e.jsx("i",{className:"bi bi-recycle"})," Restore"]})})]},r))]})})}),c.length===3?"":e.jsx("div",{className:"card-footer",children:e.jsxs("div",{className:"row",children:[e.jsx("div",{className:"col-md-6 pt-2"}),e.jsx("div",{className:"col-md-6",children:e.jsx(b,{links:c})})]})})]})]})};export{U as default};
