1"use strict";(self.webpackChunkifundicreate=self.webpackChunkifundicreate||[]).push([[895],{49895:(e,t,l)=>{l.r(t),l.d(t,{default:()=>C});var i,s=l(53256),n=l(9950),a=l(10300),d=l(28429),r=l(34903),o=l(29496);function x(){return x=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var i in l)({}).hasOwnProperty.call(l,i)&&(e[i]=l[i])}return e},x.apply(null,arguments)}function c(e,t){let{title:l,titleId:s,...a}=e;return n.createElement("svg",x({width:16,height:14,viewBox:"0 0 16 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:t,"aria-labelledby":s},a),l?n.createElement("title",{id:s},l):null,i||(i=n.createElement("path",{d:"M0.941188 9.10444V9.11766H8.94119C9.20109 9.11766 9.41178 9.32835 9.41178 9.58825C9.41178 9.84816 9.20109 10.0588 8.94119 10.0588H0.470594C0.210687 10.0588 0 9.84813 0 9.58825V8.88619C0 8.88381 0 8.88144 0 8.8791V1.11766C0 0.857752 0.210687 0.647064 0.470594 0.647064H13.1765C13.4364 0.647064 13.6471 0.857752 13.6471 1.11766V6.29413C13.6471 6.55403 13.4364 6.76472 13.1765 6.76472C12.9166 6.76472 12.7059 6.55403 12.7059 6.29413V3.25631L9.81519 5.50463L11.1231 6.58172C11.3237 6.74694 11.3524 7.04353 11.1872 7.24413C11.022 7.44475 10.7254 7.47347 10.5248 7.30822L9.05378 6.09681L7.11244 7.60675C6.9425 7.73894 6.70456 7.73894 6.53463 7.60675L4.59328 6.09681L0.941188 9.10444ZM0.941188 7.88519L3.83188 5.50463L0.941188 3.25631V7.88519ZM6.82353 6.63913L12.7059 2.06397V1.58825H0.941188V2.06397L6.82353 6.63913ZM11.2941 11.2757L11.6672 10.9025C11.851 10.7188 12.149 10.7188 12.3328 10.9025C12.5165 11.0863 12.5165 11.3843 12.3328 11.568L11.1563 12.7445C10.9725 12.9283 10.6745 12.9283 10.4908 12.7445L9.31431 11.568C9.13053 11.3843 9.13053 11.0863 9.31431 10.9025C9.49809 10.7188 9.79606 10.7188 9.97981 10.9025L10.3529 11.2757V10.5294C10.3529 8.97 11.6171 7.70588 13.1765 7.70588C14.7359 7.70588 16 8.97003 16 10.5294C16 12.0888 14.7359 13.3529 13.1765 13.3529C12.9166 13.3529 12.7059 13.1423 12.7059 12.8823C12.7059 12.6224 12.9166 12.4118 13.1765 12.4118C14.2161 12.4118 15.0588 11.569 15.0588 10.5294C15.0588 9.48981 14.2161 8.64706 13.1765 8.64706C12.1369 8.64706 11.2941 9.48981 11.2941 10.5294V11.2757Z",fill:"#008CD1"})))}const m=n.forwardRef(c);l.p;var u=l(11948),h=l(36491),p=l(79563),w=l(82839),g=l(79498),b=l(44541),f=l(29466),v=l(44414);const C=()=>{const e=(0,a.wA)(),t=(0,d.Zp)(),{userList:l}=(0,a.d4)(e=>e.user),[i,x]=(0,n.useState)([]),[c,C]=(0,n.useState)(""),[N,j]=(0,n.useState)({id:null,show:!1,type:""}
1),[y,A]=(0,n.useState)(window.innerWidth>1300);(0,n.useEffect)(()=>{e((0,f.T1)())},[e]),(0,n.useEffect)(()=>{const e=JSON.parse(localStorage.getItem("user")).roleValue;u.A.isAdmin(e)||t("/dashboard")},[t]),(0,n.useEffect)(()=>{const e=JSON.parse(localStorage.getItem("user")),t=l.filter(t=>t._id!==e._id);x(t)},[l]);const k=(e,t)=>{j({id:e,show:!0,type:t})};(0,n.useEffect)(()=>{const e=()=>{A(window.innerWidth>1300)};return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]);const I=[{field:"_id",headerName:"ID",minWidth:y?void 0:100,flex:y?1:void 0,disableColumnMenu:!0,sortable:!1},{field:"name",headerName:"Name",minWidth:y?void 0:180,flex:y?1.5:void 0,disableColumnMenu:!0,sortable:!0,renderCell:e=>(0,v.jsx)("div",{className:"cursor-pointer",onClick:()=>t(`/admin/user/${e.row._id}`),children:e.row.name})},{field:"surname",headerName:"Surname",minWidth:y?void 0:180,flex:y?1.5:void 0,disableColumnMenu:!0,renderCell:e=>(0,v.jsx)("div",{className:"cursor-pointer",onClick:()=>t(`/admin/user/${e.row._id}`),children:e.row.surname})},{field:"email",headerName:"Email",minWidth:y?void 0:220,flex:y?2:void 0,disableColumnMenu:!0},{field:"contactNumber",headerName:"Contact Number",minWidth:y?void 0:160,flex:y?1:void 0,disableColumnMenu:!0},{field:"isMarketingOptIn",headerName:"Marketing Opt-In",minWidth:y?void 0:140,flex:y?1:void 0,disableColumnMenu:!0,sortable:!0,renderCell:e=>(0,v.jsx)("span",{children:e.row.isMarketingOptIn?"Yes":"No"})},{field:"status",headerName:"Status",minWidth:y?void 0:160,flex:y?1:void 0,disableColumnMenu:!0,renderCell:e=>(0,v.jsx)("div",{style:{display:"flex",gap:"10px",alignItems:"center",height:"100%"},children:"Active"===e.row.status?(0,v.jsx)("span",{style:{color:"#CD7878",cursor:"pointer"},onClick:()=>k(e.row._id,"Active"),children:"De-activate"}):"InActive"===e.row.status?(0,v.jsx)("span",{style:{color:"#008CD1",cursor:"pointer"},onClick:()=>k(e.row._id,"InActive"),children:"Activate"}):(0,v.jsx)("span",{children:"Pending"})})},{field:"actions",headerName:"Action",minWidth:y?void 0:160,flex:y?1:void 0,disableColumnMenu:!0,sortable:!1,renderCell:l=>(0,v.jsxs)("div",{className:"h-full flex items-center justify-end gap-2",children:["Pending"===l.row.status?(0,v.jsx)(h.A,{onClick:()=>{return t=l.row.email,void e((0,b.BD)({email:t}));var t},rightIcon:(0,v.jsx)(m,{}),className:"!min-w-0 !bg-blue-100 2xl:h-[32px] 2xl:w-[32px] h-[28px] w-[28px] !p-0",toolTipTitle:"Send invite again"}):(0,v.jsx)(v.Fragment,{}),(0,v.jsx)(h.A,{rightIcon:(0,v.jsx)(o.h,{className:"2xl:w-[16px] w-[14px]"}),onClick:()=>t(`/admin/user/${l.row._id}`),className:"!min-w-0 !bg-blue-100 2xl:h-[32px] 2xl:w-[32px] h-[28px] w-[28px] !p-0",toolTipTitle:"Edit"}),(0,v.jsx)(h.A,{onClick:()=>{k(l.row._id,"Delete")},rightIcon:(0,v.jsx)(r.h,{className:"2xl:w-[16px] w-[12px]"}),className:"!min-w-0 !bg-red-100 2xl:h-[32px] 2xl:w-[32px] h-[28px] w-[28px] !p-0",toolTipTitle:"Delete"})]})}];return(0,v.jsxs)("div",{children:[(0,v.jsxs)(w.A,{open:N.show,borderTitle:!0,handleClose:()=>{j({...N,show:!1})},className:"fixed !z-[100000] w-full m-auto",children:[(0,v.jsxs)("div",{children:[(0,v.jsx)("h3",{className:"!font-[Poppins] text-3xl leading-3xl font-semibold text-blue-500",children:"Delete"===N.type?"Confirm Delete":"Active"===N.type?"Confirm Deactivation":"Confirm Activation"}),(0,v.jsx)("p",{className:"!font-[Poppins] 2xl:text-base 2xl:leading-base lg:text-sm lg:leading-sm text-xs leading-xs font-medium text-grey-700 2xl:mt-2 mt-1",children:`Are you sure you want to ${"Delete"===N.type?"delete":"Active"===N.type?"deactivate":"activate"} the user?`})]}),(0,v.jsxs)("div",{className:"max-w-[300px] flex items-center justify-center gap-5 py-8 pb-2 w-full m-auto",children:[(0,v.jsx)(h.A,{text:"Yes",onClick:()=>{"Delete"===N.type?(async()=>{e((0,f.hG)(N.id)).then(t=>{e((0,f.T1)())}),j({id:null,show:!1,type:""})})():((t,l)=>{const i={_id:t,newStatus:"Active"===l?"InActive":"Active"};e((0,f.pU)(i)).then(t=>{t.payload.status&&e((0,f.T1)())}),j({id:null,show:!1,type:""})})(N.id,N.type)},className:"shadow-[0px_10px_40px_0px_#0C71C326] !bg-blue-500 !text-white 2xl:!text-base 2xl:!leading-base lg:!text-sm lg:!leading-sm !text-xs !leading-xs !rounded-lg !font-medium !p-3 !min-w-[120px] !border-solid !border-blue-500 !border hover:!bg-blue-700 hover:!border-blue-700"}),(0,v.jsx)(h.A,{onClick:()=>{j({...N,show:!1})},text:"No",className:"!bg-white !text-blue-500 2xl:!text-base 2xl:!leading-base lg:!text-sm lg:!leading-sm !text-xs !leading-xs !rounded-lg !font-medium !p-3 !min-w-[120px] !border-solid !border-blue-500 !border hover:!bg-blue-500 hover:!text-white"})]})]}),(0,v.jsxs)("div",{className:"mb-6",children:[(0,v.jsx)("h2",{className:"!font-[Poppins] xl
1:text-3xl xl:leading-3xl text-2xl leading-2xl text-blue-500 font-semibold",children:"Users"}),(0,v.jsx)("p",{className:"!font-[Poppins] lg:text-sm lg:leading-sm text-xs leading-xs font-medium text-grey-700 mt-1",children:"This screen will assist with adding the new user and view the list of all users."})]}),(0,v.jsxs)("div",{className:"border border-solid border-blue-200 rounded-xl overflow-hidden bg-white table-list",children:[(0,v.jsxs)("div",{className:"flex items-center justify-between p-3",children:[(0,v.jsx)(g.A,{fullWidth:!0,value:c,onChange:e=>C(e.target.value),showIcon:!0,className:"2xl:max-w-[500px] xl:max-w-[400px] max-w-[300px]",placeholder:"Search"}),(0,v.jsx)(h.A,{onClick:()=>t("/admin/user/new"),text:"Add New User",leftIcon:(0,v.jsx)(s.A,{className:" 2xl:!text-3xl 2xl:!leading-3xl !text-2xl !leading-2xl mr-1"}),className:"!font-[Poppins] !normal-case !max-w-[200px] !text-white !bg-blue-500 hover:!bg-blue-700 !w-full !p-3 2xl:!text-base 2xl:!leading-base lg:!text-sm lg:!leading-sm !text-xs !leading-xs !rounded-lg "})]}),(0,v.jsx)(p.A,{searchQuery:c,columns:I,rows:i,pageSize:25,page:1,getRowId:e=>e._id})]})]})}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.