PageSourceSearch

https://ripplemind.com/_next/static/chunks/1830-cc649a0209020590.js

js ripplemind.com collected 2026-10-06 13:18:04 UTC 9,650 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1830],{42689:function(e,a,t){t.r(a);var n=t(85893),s=t(67294),l=t(41664),r=t.n(l),d=t(11163),c=t(88446),m=t(86501);a.default=e=>{let{children:a}=e,t=(0,d.useRouter)(),{companyId:l}=t.query,[i,o]=(0,s.useState)(null),[p,u]=(0,s.useState)(!0),x=[{name:"Employees",path:"/salary-management/company/".concat(l,"/employees")},{name:"Departments",path:"/salary-management/company/".concat(l,"/department")},{name:"Attendance",path:"/salary-management/company/".concat(l,"/attendance")},{name:"Designations",path:"/salary-management/company/".concat(l,"/designation")},{name:"Salary List",path:"/salary-management/company/".concat(l,"/salary-list")},{name:"Holidays",path:"/salary-management/company/".concat(l,"/holidays")},{name:"Religion",path:"/salary-management/company/".concat(l,"/religion")}].sort((e,a)=>e.name.localeCompare(a.name));return(0,s.useEffect)(()=>{if(!l)return;let e=async()=>{var e,a,t;try{let a=await c.Z.post("/payroll/company/company-by-id",{company_id:l});o(null===(e=a.data)||void 0===e?void 0:e.data)}catch(e){m.ZP.error((null==e?void 0:null===(a=e.response)||void 0===a?void 0:null===(t=a.data)||void 0===t?void 0:t.message)||"Error fetching company"),console.error("❌ Error fetching company:",e)}finally{u(!1)}};e()},[l]),(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:[p?(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==i?void 0:i.logo_url)&&(0,n.jsx)("img",{src:i.logo_url,alt:i.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==i?void 0:i.company_name)||"Company"})]}),(0,n.jsx)("ul",{className:"space-y-2 mb-6",children:x.map(e=>(0,n.jsx)("li",{children:(0,n.jsx)(r(),{href:e.path,children:(0,n.jsx)("span",{className:"block px-3 py-2 rounded-md cursor-pointer transition-colors ".concat(t.asPath.startsWith(e.path)?"bg-gray-700 font-semibold":"hover:bg-gray-800"),children:e.name})})},e.path))}),(0,n.jsx)(r(),{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:a})})]})}},28646:function(e,a,t){var n=t(85893),s=t(41664),l=t.n(s),r=t(11163);t(67294),a.Z=()=>{let e=(0,r.useRouter)(),a=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)(l(),{className:"text-blue-500",href:"/login?re_url=".concat(a),children:"Click here to Login"})]})}},69708:function(e,a,t){var n=t(85893),s=t(67294),l=t(88446),r=t(86501),d=t(11163),c=t(41664),m=t.n(c);a.Z=e=>{let{companyId:a,id:t}=e,c=(0,d.useRouter)(),[i,o]=(0,s.useState)({department_id:"",department_name:"",department_status:!0,department_description:""}),[p,u]=(0,s.useState)({department_name:""}
1),[x,h]=(0,s.useState)({loading:!1,success:"",error:""});(0,s.useEffect)(()=>{if(!t)return;let e=async()=>{h({loading:!0,success:"",error:""});try{var e;let n=await l.Z.post("/payroll/department/department-by-id",{departmentId:t,company_id:Number(a)}),s=null==n?void 0:null===(e=n.data)||void 0===e?void 0:e.data;s?o({department_id:s.id,department_description:s.description||"",department_name:s.name||"",department_status:!!s.is_active}):h({loading:!1,success:"",error:"No data found"}),h(e=>({...e,loading:!1}))}catch(e){h({loading:!1,success:"",error:e.message||"Something went wrong"})}};e()},[t]);let g=e=>{let{name:a,value:t}=e.target;o(e=>({...e,[a]:"department_status"===a?"true"===t:t})),u(e=>({...e,[a]:""}))},y=()=>{let e={};return i.department_name||(e.department_name="Department name is required"),u(e),0===Object.keys(e).length},f=async()=>{if(!y()){r.ZP.error("Please update all required fields.");return}h({loading:!0,success:"",error:""});let e={name:i.department_name,description:i.department_description,departmentId:i.department_id,is_active:i.department_status,company_id:Number(a)};try{t?(await l.Z.put("/payroll/department/update",e),r.ZP.success("Department updated successfully!")):(await l.Z.post("/payroll/department/create",e),r.ZP.success("Department added successfully!")),c.push("/salary-management/company/".concat(a,"/department"))}catch(e){h({loading:!1,success:"",error:t?"Failed to update department!":"Failed to add department!"}),r.ZP.error(e.response.data.message)}};return(0,n.jsx)("div",{children:(0,n.jsx)("div",{className:"container mx-auto",children:(0,n.jsxs)("div",{className:"py-5 px-2 lg:px-8",children:[(0,n.jsx)("h2",{className:"font-bold mb-2",children:t?"Department Edit":"Department Add"}),(0,n.jsx)("div",{className:"container mx-auto py-1",children:(0,n.jsxs)("ul",{className:"flex flex-wrap items-center",children:[(0,n.jsxs)("li",{className:"inline-flex items-center",children:[(0,n.jsx)(m(),{href:"/salary-management/company/".concat(a,"/department"),children:(0,n.jsx)("span",{className:"text-gray-600 hover:text-blue-500",children:"Department List"})}),(0,n.jsx)("i",{className:"fa fa-angle-right mx-3 text-gray-400"})]}),(0,n.jsx)("li",{className:"inline-flex items-center",children:(0,n.jsx)("span",{className:"text-blue-500",children:t?"Edit":"Add"})})]})}),(0,n.jsx)("div",{className:"py-3",children:(0,n.jsx)(m(),{href:"/salary-management/company/".concat(a,"/department"),children:(0,n.jsx)("button",{className:"shadow bg-slate-300 hover:bg-slate-400 text-black py-2 px-4 rounded",type:"button",children:"Back"})})}),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"flex flex-col md:flex-row lg:flex-row items-center pb-3",children:[(0,n.jsx)("div",{className:"w-full md:w-[40%] lg:w-1/5",children:(0,n.jsx)("label",{className:"block text-black font-semibold text-sm mb-1",children:"Name*"})}),(0,n.jsxs)("div",{className:"w-full lg:w-[40%]",children:[(0,n.jsx)("div",{className:"md:ml-[-21%] md:w-[68%] lg:w-[119%] lg:ml-[-1%]",children:(0,n.jsx)("input",{name:"department_name",type:"text",value:i.department_name,className:"border-2 border-gray-200 rounded w-full md:ml-[26%] lg:ml-[0%] lg:w-3/4 py-2 px-4 text-gray-700 text-sm bg-slate-200",placeholder:"Name",onChange:g,onKeyDown:e=>{(38===e.keyCode||40===e.keyCode)&&e.preventDefault()}})}),p.department_name&&(0,n.jsx)("div",{className:"text-red-300 text-sm mt-1",children:p.department_name})]})]}),(0,n.jsxs)("div",{className:"flex flex-col md:flex-row lg:flex-row items-center pb-3",children:[(0,n.jsx)("div",{className:"w-full md:w-[40%] lg:w-1/5",children:(0,n.jsx)("label",{className:"block text-black font-semibold text-sm mb-1",children:"Description"})}),(0,n.jsx)("div",{className:"w-full lg:w-[40%]",children:(0,n.jsx)("div",{className:"md:ml-[-21%] md:w-[68%] lg:w-[119%] lg:ml-[-1%]",children:(0,n.jsx)("input",{name:"department_description",type:"text",value:i.department_description,className:"border-2 border-gray-200 rounded w-full md:ml-[26%] lg:ml-[0%] lg:w-3/4 py-2 px-4 text-gray-700 text-sm bg-slate-200",placeholder:"Description",onChange:g,onKeyDown:e=>{(38===e.keyCode||40===e.keyCode)&&e.preventDefault()}})})})]}),(0,n.jsxs)("div",{className:"flex flex-col md:flex-row lg:flex-row items-center pb-3",children:[(0,n.jsx)("div",{className:"w-full md:w-[40%] lg:w-1/5",children:(0,n.jsx)("label",{className:"block text-black font-semibold text-sm mb-1",children:"Status*"})}),(0,n.jsx)("div",{className:"w-full lg:w-[40%]",children:(0,n.jsx)("div",{className:"md:ml-[-21%] md:w-[68%] lg:w-[119%] lg:ml-[-1%]",children:(0,n.jsxs)("select",{name:"department_status",value:i.department_status?"true":"false",className:"border-2 border-gray-200 rounded w-full md:ml-[26%] lg:ml-[0%] lg:w-3/4 py-2 px-4 text-gray-700 text-sm bg-slate-200",onChange:g,children:[(0,n.jsx)("option",{value:"true",children:"True"}),(0,n.jsx)("option",{value:"false",children:"False"})]})})})]})]}),(0,n.jsx)("div",{className:"pt-4",children:x.loading?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"pb-3",children:(0,n.jsx)("p",{className:"text-blue-400 text-sm bg-blue-100 p-2 rounded",children:"Loading..."})}),(0,n.jsx)("button",{className:"shadow bg-yellow-400 hover:bg-yellow-500 text-white py-2 px-4 roun
1ded",type:"button",children:"Loading..."})]}):(0,n.jsxs)("div",{children:[(0,n.jsx)("button",{className:"shadow bg-blue-500 hover:bg-blue-600 text-white py-2 px-4 rounded",type:"button",onClick:f,children:t?"Update":"Add"}),(0,n.jsx)(m(),{href:"/salary-management/company/".concat(a,"/department"),children:(0,n.jsx)("button",{className:"shadow bg-slate-300 hover:bg-slate-400 text-black py-2 px-4 rounded ml-3",type:"button",children:"Back"})})]})})]})})})}},11846:function(e,a,t){t.d(a,{Z:function(){return d}});var n=t(85893),s=t(48583),l=t(94543),r=t(28646);function d(e){let{children:a}=e,t=(0,s.Dv)(l.ZP);return t.isLoggedIn?a:(0,n.jsx)(r.Z,{})}},64270:function(e,a,t){t.d(a,{N:function(){return r},P:function(){return l}});var n=t(11163),s=t(67294);function l(e){let a=(0,n.useRouter)(),[t,l]=(0,s.useState)(null);return(0,s.useEffect)(()=>{if(a.isReady){let t=a.query[e];if("string"==typeof t){let e=Number(t);e>=1&&l(e)}}},[a.isReady,a.query,e]),t}function r(e){let a=(0,n.useRouter)(),[t,l]=(0,s.useState)(null);return(0,s.useEffect)(()=>{if(a.isReady){let t=a.query[e];"string"==typeof t&&""!==t.trim()&&l(t)}},[a.isReady,a.query,e]),t}}}]);

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.