1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7882],{90470:function(e,t,a){"use strict";a.d(t,{Z:function(){return r}});var n=a(91373);let r=(0,n.Z)("pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]])},31012:function(e,t,a){"use strict";a.d(t,{Z:function(){return r}});var n=a(91373);let r=(0,n.Z)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},13671:function(e,t,a){"use strict";a.d(t,{Z:function(){return r}});var n=a(91373);let r=(0,n.Z)("trash",[["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]])},18713:function(e,t,a){(window.__NEXT_P=window.__NEXT_P||[]).push(["/salary-management/company/[companyId]/religion",function(){return a(41983)}])},42689:function(e,t,a){"use strict";a.r(t);var n=a(85893),r=a(67294),i=a(41664),l=a.n(i),s=a(11163),o=a(88446),c=a(86501);t.default=e=>{let{children:t}=e,a=(0,s.useRouter)(),{companyId:i}=a.query,[d,u]=(0,r.useState)(null),[m,h]=(0,r.useState)(!0),y=[{name:"Employees",path:"/salary-management/company/".concat(i,"/employees")},{name:"Departments",path:"/salary-management/company/".concat(i,"/department")},{name:"Attendance",path:"/salary-management/company/".concat(i,"/attendance")},{name:"Designations",path:"/salary-management/company/".concat(i,"/designation")},{name:"Salary List",path:"/salary-management/company/".concat(i,"/salary-list")},{name:"Holidays",path:"/salary-management/company/".concat(i,"/holidays")},{name:"Religion",path:"/salary-management/company/".concat(i,"/religion")}].sort((e,t)=>e.name.localeCompare(t.name));return(0,r.useEffect)(()=>{if(!i)return;let e=async()=>{var e,t,a;try{let t=await o.Z.post("/payroll/company/company-by-id",{company_id:i});u(null===(e=t.data)||void 0===e?void 0:e.data)}catch(e){c.ZP.error((null==e?void 0:null===(t=e.response)||void 0===t?void 0:null===(a=t.data)||void 0===a?void 0:a.message)||"Error fetching company"),console.error("â Error fetching company:",e)}finally{h(!1)}};e()},[i]),(0,n.jsxs)("div",{className:"flex min-h-screen",children:[(0,n.jsxs)("aside",{className:"w-64 flex-shrink-0 bg-gray-900 text-white p-4",children:[m?(0,n.jsx)("h2",{className:"text-lg font-bold mb-6",children:"Loading..."}):(0,n.jsxs)("div",{className:"flex items-center gap-3 my-3",children:[(null==d?void 0:d.logo_url)&&(0,n.jsx)("img",{src:d.logo_url,alt:d.company_name,className:"w-12 h-12 rounded-full object-cover border border-gray-700"}),(0,n.jsx)("h2",{className:"text-lg font-bold truncate",children:(null==d?void 0:d.company_name)||"Company"})]}),(0,n.jsx)("ul",{className:"space-y-2 mb-6",children:y.map(e=>(0,n.jsx)("li",{children:(0,n.jsx)(l(),{href:e.path,children:(0,n.jsx)("span",{className:"block px-3 py-2 rounded-md cursor-pointer transition-colors ".concat(a.asPath.startsWith(e.path)?"bg-gray-700 font-semibold":"hover:bg-gray-800"),children:e.name})})},e.path))}),(0,n.jsx)(l(),{href:"/salary-management/company",children:(0,n.jsx)("span",{className:"block mt-6 text-sm text-gray-300 hover:text-white",children:"â Back to Companies"})})]}),(0,n.jsx)("main",{className:"flex-1 p-3 bg-gray-100 overflow-x-auto",children:(0,n.jsx)("div",{className:"min-w-[1200px]",children:t})})]})}},41983:function(e,t,a){"use strict";a.r(t),a.d(t,{default:function(){return v}});var n=a(85893),r=a(42689),i=a(67294),l=a(88446),s=a(90044),o=a(87083),c=a(41664),d=a.n(c),u=a(90470),m=a(13671),h=a(31012),y=a(17866),p=a(8823),g=e=>{let{companyId:t}=e,[a,r]=(0,i.useState)(0),[c,g]=(0,i.useState)([]),[x,f]=(0,i.useState)(1),[v,j]=(0,i.useState)(20),[b,N]=(0,i.useState)({sortKey:"name",sortType:1}),[w,Z]=(0,i.useState)(!1),_={display:"flex",justifyContent:"center",width:"100%"},S=async(e,a)=>{let n=window.confirm("Are you sure you want to deactivate this religion?");if(n)try{let n=await l.Z.delete("/payroll/religion/delete",{data:{religion_id:e,company_id:Number(t)}});200===n.status?(alert("Religion deactivated successfully!"),a()):alert("Failed to delete religion.")}catch(e){console.error("Error deleting religion:",e),alert("An error occurred while deleting the religion.")}},k=async()=>{Z(!0);try{var e,a;let n=await l.Z.post("/payroll/religion/list",{page_enabled:"y",page:x,limit:v,sortDetails:b,searchDetails:[],searchDetailsAnd:[{basicSearchKey:"",basicSearchValue:"",basicSearchType:""}],searchQuery:"",company_id:t}),i=(null===(e=n.data)||void 0===e?void 0:e.data)||[];g(i),r((null===(a=n.data)||void 0===a?void 0:a.data.length)||0)}catch(e){console.error("Failed to fetch employee list:",e)}finally{Z(!1)}};return(0,i.useEffect)(()=>{k()},[x,v,b]),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"px-4 pt-4",children:[(0,n.jsx)("h1",{className:"text-2xl mb-1",children:"Religion Details (".concat(a,")")}),(0,n.jsx)(o.ZP,{content:(0,n.jsx)("span",{className:"text-xs",children:"Add New"}),placement:"bottom",children:(0,n.jsx)(d(),{href:"/salary-management/company/".concat(t,"/religion/add"),children:(0,n.jsx)("button",{className:"p-2 bg-gray-300 hover:bg-gray-400 py-2 px-3 rounded ml-1",children:(0,n.jsx)(h.Z,{className:"w-4 h-4 text-gray-700"})})})})]}),(0,n.jsx)("div",{className:"pt-2 p-4",children:(0,n.jsx)(s.ZP,{columns:[{name:(0,n.jsx)("div",{style:_,children:"Action"}),width:"160px",cell:e=>(0,n.jsxs)("div",{style:_,children:[(0,n.jsx)(o.ZP,{content:(0,n.jsx)("span",{children:"Edit"}),placement:"bottom",children:(0,n.jsx)(d(),{href:"/salary-management/company/".concat(t,"/religion/").concat(e.religion_id,"/edit"),children:(0,n.jsx)("button",{className:"m-1 inline p-5 bg-gray-300 hover:bg-gray-400 text-black py-2 px-4 roun
1ded",children:(0,n.jsx)(u.Z,{className:"w-4 h-4 text-gray-700"})})})}),(0,n.jsx)(o.ZP,{content:(0,n.jsx)("span",{children:"Delete"}),placement:"bottom",children:(0,n.jsx)("button",{className:"m-1 inline p-5 bg-gray-300 hover:bg-gray-400 text-black py-2 px-4 rounded",onClick:()=>S(e.religion_id,k),children:(0,n.jsx)(m.Z,{className:"w-4 h-4 text-gray-700"})})})]})},{name:(0,n.jsx)("div",{style:_,children:"ID"}),id:"religion_id",minWidth:"90px",cell:e=>(0,n.jsx)("div",{style:_,children:(0,y.Z)(e.religion_id)}),sortable:!0},{name:(0,n.jsx)("div",{style:_,children:"Name"}),id:"name",minWidth:"150px",cell:e=>(0,n.jsx)("div",{children:(0,y.Z)(e.name)}),sortable:!0},{name:(0,n.jsx)("div",{style:_,children:"Active"}),id:"isActive",minWidth:"150px",cell:e=>(0,n.jsx)("div",{children:(0,y.Z)(!0==e.isActive?"Yes":"No")}),sortable:!0},{name:(0,n.jsx)("div",{style:_,children:"Created At"}),id:"createdAt",minWidth:"150px",cell:e=>(0,n.jsx)("div",{children:(0,y.Z)(new Date(e.createdAt).toLocaleString())}),sortable:!0},{name:(0,n.jsx)("div",{style:_,children:"Updated At"}),id:"updatedAt",minWidth:"150px",cell:e=>(0,n.jsx)("div",{children:(0,y.Z)(new Date(e.updatedAt).toLocaleString())}),sortable:!0}],data:c,progressPending:w,pagination:!0,paginationServer:!0,paginationPerPage:v,paginationRowsPerPageOptions:[5,10,20,30,50,100],paginationTotalRows:a,onChangeRowsPerPage:e=>{f(1),j(e)},onChangePage:e=>{f(e)},sortServer:!0,defaultSortFieldId:"col_".concat(b.sortKey),defaultSortAsc:1===b.sortType,onSort:(e,t)=>{let a={sortKey:"string"==typeof(null==e?void 0:e.id)?e.id.replace("col_",""):"id",sortType:"desc"===t?-1:1};N(a)},fixedHeader:!0,fixedHeaderScrollHeight:"64vh",customStyles:p.Z,highlightOnHover:!0})})]})},x=a(11846),f=a(64270),v=()=>{let e=(0,f.P)("companyId");return!e||e<1?null:(0,n.jsx)(x.Z,{children:(0,n.jsx)(r.default,{children:(0,n.jsx)(g,{companyId:e})})})}},28646:function(e,t,a){"use strict";var n=a(85893),r=a(41664),i=a.n(r),l=a(11163);a(67294),t.Z=()=>{let e=(0,l.useRouter)(),t=e.asPath;return(0,n.jsxs)("div",{className:"md:mx-28 text-center text-red-500 p-10 bg-gray-100 text-xl",children:["Your are not Logged in to use this functionality .......! ",(0,n.jsx)("br",{}),(0,n.jsx)(i(),{className:"text-blue-500",href:"/login?re_url=".concat(t),children:"Click here to Login"})]})}},8823:function(e,t){"use strict";t.Z={headCells:{style:{border:"1px solid #f1f1f1",fontSize:"14px",backgroundColor:"#e1e1e1"}},cells:{style:{border:"1px solid #f1f1f1",paddingLeft:"7px",paddingRight:"7px"}}}},11846:function(e,t,a){"use strict";a.d(t,{Z:function(){return s}});var n=a(85893),r=a(48583),i=a(94543),l=a(28646);function s(e){let{children:t}=e,a=(0,r.Dv)(i.ZP);return a.isLoggedIn?t:(0,n.jsx)(l.Z,{})}},17866:function(e,t){"use strict";t.Z=e=>{try{if("string"==typeof e||"number"==typeof e)return"".concat(e);return"-"}catch(e){return console.error(e),"-----"}}},64270:function(e,t,a){"use strict";a.d(t,{N:function(){return l},P:function(){return i}});var n=a(11163),r=a(67294);function i(e){let t=(0,n.useRouter)(),[a,i]=(0,r.useState)(null);return(0,r.useEffect)(()=>{if(t.isReady){let a=t.query[e];if("string"==typeof a){let e=Number(a);e>=1&&i(e)}}},[t.isReady,t.query,e]),a}function l(e){let t=(0,n.useRouter)(),[a,i]=(0,r.useState)(null);return(0,r.useEffect)(()=>{if(t.isReady){let a=t.query[e];"string"==typeof a&&""!==a.trim()&&i(a)}},[t.isReady,t.query,e]),a}}},function(e){e.O(0,[44,5655,9774,2888,179],function(){return e(e.s=18713)}),_N_E=e.O()}]);
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.