| Current Path : /home/users/unlimited/www/ondemand.codeskitter.site/build/static/js/ |
| Current File : /home/users/unlimited/www/ondemand.codeskitter.site/build/static/js/409.dfe42196.chunk.js |
"use strict";(self.webpackChunkproject=self.webpackChunkproject||[]).push([[409],{25409:(t,e,i)=>{i.r(e),i.d(e,{NotificationList:()=>F,default:()=>W});var n=i(65043),s=i(72653),a=i(96446),o=i(19252),r=i(22698),x=i(85865),c=i(68903),l=i(12110),d=i(36591),h=i(26494),m=i(88911),p=i(59135),g=i(78185),j=i(42518),A=i(7416),f=i(26240),u=i(41503),b=i(44978),y=i(84289),w=i(36171),v=i(53536),S=i(39213),k=i(38335),C=i(95538),N=i(70579);const F=()=>{const[t,e]=(0,n.useState)([]),[i,s]=(0,n.useState)(!1),[r,A]=(0,n.useState)(0),[u,y]=(0,n.useState)(0),[F,W]=(0,n.useState)(!1),_=async t=>{try{const t=await w.A.userNotifications({limit:5,offset:u});e(t.data),A(t.total),s(!0),W(!1)}catch(F){console.error("Error fetching notifications:",F),W(!0),s(!1)}};(0,n.useEffect)((()=>{_()}),[u]);const B=(0,f.A)(),T=r,D=Math.ceil(T/3);return(0,N.jsx)(N.Fragment,{children:F?(0,N.jsx)(a.A,{children:i?(0,N.jsxs)(o.A,{children:[(0,N.jsx)(g.A,{height:"100px"}),(0,N.jsx)(g.A,{height:"100px"}),(0,N.jsx)(g.A,{height:"100px"}),(0,N.jsx)(g.A,{height:"100px"}),(0,N.jsx)(g.A,{height:"100px"}),(0,N.jsx)(g.A,{height:"100px"})]}):(0,N.jsxs)(c.Ay,{container:!0,spacing:2,direction:"column",alignItems:"center",justifyContent:"center",height:"100vh",sx:{marginTop:{xs:0,md:-20}},children:[(0,N.jsx)(c.Ay,{item:!0,children:(0,N.jsx)(d.A,{component:"img",src:S,alt:"No Data Image",sx:{width:{xs:300,sm:600,md:700},height:"auto",border:"none",boxShadow:"none"}})}),(0,N.jsx)(c.Ay,{item:!0,children:(0,N.jsxs)(x.A,{sx:{textAlign:"center",marginTop:{xs:0,md:-22}},children:[(0,N.jsx)(x.A,{variant:"body1",sx:{textAlign:"left",fontFamily:"Plus Jakarta Sans",fontWeight:"bold",fontSize:"32px",lineHeight:"32px",letterSpacing:"0px"},children:(0,b.t)("something_went_wrong")}),(0,N.jsx)(x.A,{variant:"body1",sx:{color:"var(--secondary-color-343f53)",textAlign:"left",fontFamily:"Plus Jakarta Sans",fontWeight:"normal",fontSize:"20px",lineHeight:"32px",letterSpacing:"0px",opacity:.7,marginLeft:5},children:(0,b.t)("try_again_later")})]})}),(0,N.jsx)(c.Ay,{item:!0,children:(0,N.jsx)(j.A,{variant:"contained",onClick:_,sx:{textTransform:"none",marginTop:{xs:0,md:-28}},children:(0,b.t)("retry")})})]})}):(0,N.jsx)(a.A,{sx:{maxWidth:"100%",bgcolor:B.palette.background.box,padding:0},children:i?(0,N.jsx)(N.Fragment,{children:t&&(null===t||void 0===t?void 0:t.length)>0?(0,N.jsxs)(a.A,{sx:{backgroundColor:B.palette.background.box},children:[t.map((t=>(0,N.jsx)(a.A,{sx:{boxShadow:"none"},children:(0,N.jsx)(l.A,{sx:{display:"flex",backgroundColor:B.palette.background.box,mt:2,mx:3,boxShadow:"none",borderBottom:"rgba(128, 128, 128, 0.14) 2px solid"},children:(0,N.jsxs)(a.A,{sx:{display:"flex",flexDirection:{xs:"column",sm:"row",md:"row"},mx:3,alignItems:"center",width:"100%"},children:[(0,N.jsx)(d.A,{component:"img",sx:{width:{xs:"100%",sm:151,md:"70px"},height:{xs:"100%",sm:151,md:"70px"},borderRadius:{xs:"10px",md:"50%"}},image:t.image||k,onError:t=>{t.target.src=k},alt:"Notification Image"}),(0,N.jsx)(a.A,{sx:{display:"flex",flexDirection:"column"},width:"100%",ml:.5,children:(0,N.jsxs)(h.A,{sx:{flex:"1 0 auto",display:"flex",flexWrap:{xs:"wrap",lg:"nowrap"},gap:{xs:"12px",lg:"0px"}},children:[(0,N.jsxs)(a.A,{display:"flex",flexDirection:"column",width:"90%",justifyContent:"space-between",children:[(0,N.jsx)(x.A,{component:"div",variant:"h6",children:t.title}),(0,N.jsx)(x.A,{variant:"subtitle2",color:"text.secondary",component:"div",children:t.message})]}),(0,N.jsx)(x.A,{variant:"subtitle2",color:"text.secondary",component:"div",children:t.duration})]})})]})})},t.id))),(0,N.jsx)(a.A,{display:"flex",justifyContent:"center",mt:12,pb:3,children:(0,N.jsx)(m.A,{spacing:2,children:D>0?(0,N.jsx)(p.A,{showFirstButton:!0,showLastButton:!0,count:(0,v.ceil)(r/5),onChange:(t,e)=>{y(5*(e-1))}}):""})})]}):(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(a.A,{display:"flex",maxWidth:"100%",justifyContent:"center",children:(0,N.jsx)(a.A,{component:"img",src:C,alt:"NO SUB CATEGORY FOUND",sx:{maxWidth:"100%"},width:"auto"})}),(0,N.jsx)(a.A,{display:"flex",justifyContent:"center",children:(0,N.jsx)(x.A,{variant:"body1",children:(0,b.t)("no_notifications")})})]})}):(0,N.jsxs)(o.A,{children:[(0,N.jsx)(g.A,{height:"100px"}),(0,N.jsx)(g.A,{height:"100px"}),(0,N.jsx)(g.A,{height:"100px"}),(0,N.jsx)(g.A,{height:"100px"}),(0,N.jsx)(g.A,{height:"100px"}),(0,N.jsx)(g.A,{height:"100px"})]})})})},W=()=>{document.title="Profile - Notifications | HausMate";const t=(0,f.A)();return(0,N.jsxs)(y.A,{children:[(0,N.jsx)(a.A,{paddingTop:"35px",paddingBottom:"35px",mt:2,children:(0,N.jsxs)(o.A,{maxWidth:"lg",className:"mainContainer",children:[(0,N.jsxs)(r.A,{separator:"|","aria-label":"breadcrumb",className:"mb-1 mt-1",children:[(0,N.jsx)(A.w1,{to:"/",className:"breadcrumb",sx:{mb:0},children:(0,N.jsx)("strong",{children:(0,b.t)("home")})}),(0,N.jsx)(x.A,{color:"text.primary",children:(0,N.jsx)("strong",{children:(0,b.t)("profile")})})]}),(0,N.jsx)(x.A,{variant:"h4",gutterBottom:!0,sx:{mt:"12px"},children:(0,N.jsx)("strong",{children:(0,b.t)("notifications")})})]})}),(0,N.jsx)(o.A,{className:"notification-container mainContainer",sx:{mt:"-40px"},children:(0,N.jsxs)(c.Ay,{container:!0,spacing:1,children:[(0,N.jsx)(c.Ay,{item:!0,xs:12,md:4,children:(0,N.jsx)(u.A,{})}),(0,N.jsx)(c.Ay,{item:!0,xs:12,md:8,children:(0,N.jsxs)(a.A,{sx:{mt:3,background:t.palette.background.box,borderRadius:"10px"},children:[(0,N.jsx)(s.A,{heading:(0,b.t)("notifications")}),(0,N.jsx)(a.A,{minHeight:500,children:(0,N.jsx)(F,{})})]})})]})})]})}},39213:(t,e,i)=>{t.exports=i.p+"static/media/No__data-pana.58fcb25b54a6443b1d4b.png"}}]);
//# sourceMappingURL=409.dfe42196.chunk.js.map