import{r as c,j as e}from"./index-Bkt-lHwp.js";import{u as d}from"./useQuery-DZshbfbI.js";import{H as n}from"./HistoryCard-DL_rI8DX.js";import"./skeleton.esm-Bgz-wNI4.js";function h(){const[o,a]=c.useState([]),t={url:`/api/user/logins-history?currLen=${o.length}`,onSuccess:s=>{s.status==1&&a(r=>[...r,...s.data])},onError:s=>{console.log("err: ",s),window.toast({type:"error",message:"Unable To Communicate With Server To Fetch Your History. Please Try Again Later"})}},{data:i,isLoading:m,refetch:p}=d(t),l=()=>p(t),u={width:"98vw",maxWidth:"38rem"};return e.jsxDEV("div",{className:"px-2 pb-6 mx-auto",style:u,children:[e.jsxDEV("p",{className:"flex align-items-center gap-1 text-lg font-semibold",children:[e.jsxDEV("i",{className:"pi pi-users text-xl font-semibold mr-1"},void 0,!1,{fileName:"C:/Users/pc/Desktop/otp-website-mainsmmprovider-/src/user/pages/Login-History/index.jsx",lineNumber:36,columnNumber:5},this),e.jsxDEV("span",{className:"capitalize",children:"Login History"},void 0,!1,{fileName:"C:/Users/pc/Desktop/otp-website-mainsmmprovider-/src/user/pages/Login-History/index.jsx",lineNumber:37,columnNumber:5},this)]},void 0,!0,{fileName:"C:/Users/pc/Desktop/otp-website-mainsmmprovider-/src/user/pages/Login-History/index.jsx",lineNumber:35,columnNumber:4},this),o.map((s,r)=>e.jsxDEV(n,{data:s},r,!1,{fileName:"C:/Users/pc/Desktop/otp-website-mainsmmprovider-/src/user/pages/Login-History/index.jsx",lineNumber:40,columnNumber:5},this)),m&&["_1","_2","_3"].map(s=>e.jsxDEV(n,{loading:!0},s,!1,{fileName:"C:/Users/pc/Desktop/otp-website-mainsmmprovider-/src/user/pages/Login-History/index.jsx",lineNumber:43,columnNumber:35},this)),(i==null?void 0:i.isEnd)&&e.jsxDEV("p",{className:"text-gray-700 text-center my-3",children:"That's It. Login History Finished !!"},void 0,!1,{fileName:"C:/Users/pc/Desktop/otp-website-mainsmmprovider-/src/user/pages/Login-History/index.jsx",lineNumber:45,columnNumber:5},this),i&&!i.isEnd&&!m?e.jsxDEV("button",{onClick:l,className:"border-1 border-primary bg-primary text-white hover:bg-white hover:text-primary text-lg font-medium p-2 px-6 flex align-items-center gap-2 mx-auto border-round",children:[e.jsxDEV("span",{children:"View More"},void 0,!1,{fileName:"C:/Users/pc/Desktop/otp-website-mainsmmprovider-/src/user/pages/Login-History/index.jsx",lineNumber:54,columnNumber:6},this),e.jsxDEV("i",{className:"pi pi-angle-double-down"},void 0,!1,{fileName:"C:/Users/pc/Desktop/otp-website-mainsmmprovider-/src/user/pages/Login-History/index.jsx",lineNumber:55,columnNumber:6},this)]},void 0,!0,{fileName:"C:/Users/pc/Desktop/otp-website-mainsmmprovider-/src/user/pages/Login-History/index.jsx",lineNumber:50,columnNumber:5},this):null]},void 0,!0,{fileName:"C:/Users/pc/Desktop/otp-website-mainsmmprovider-/src/user/pages/Login-History/index.jsx",lineNumber:34,columnNumber:3},this)}export{h as default};
