1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5116],{89427:function(e,a,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/salary-management/company/add",function(){return n(59184)}])},30279:function(e,a,n){"use strict";n.r(a);var r=n(85893),o=n(41664),s=n.n(o),l=n(11163);a.default=e=>{let{children:a}=e,n=(0,l.useRouter)();return(0,r.jsxs)("div",{className:"flex min-h-screen",children:[(0,r.jsxs)("aside",{className:"w-64 bg-gray-900 text-white p-4",children:[(0,r.jsx)("h2",{className:"text-lg font-bold mb-6",children:"Salary Management"}),(0,r.jsx)("ul",{className:"space-y-3",children:[{name:"Dashboard",path:"/salary-management"},{name:"Companies",path:"/salary-management/company"}].map(e=>(0,r.jsx)("li",{children:(0,r.jsx)(s(),{href:e.path,children:(0,r.jsx)("span",{className:"block px-3 py-2 rounded-md cursor-pointer ".concat(n.pathname.startsWith(e.path)?"bg-gray-700 font-semibold":"hover:bg-gray-800"),children:e.name})})},e.path))})]}),(0,r.jsx)("main",{className:"flex-1 p-6 bg-gray-100",children:a})]})}},59184:function(e,a,n){"use strict";n.r(a);var r=n(85893),o=n(74857),s=n(30279),l=n(88446),t=n(86501),m=n(11163),c=n(11846);a.default=()=>{let e=(0,m.useRouter)(),a=async a=>{try{await l.Z.post("/payroll/company/create",a),t.ZP.success("Company added successfully"),e.push("/salary-management/company")}catch(e){var n,r;t.ZP.error((null==e?void 0:null===(n=e.response)||void 0===n?void 0:null===(r=n.data)||void 0===r?void 0:r.message)||"Error adding company"),console.error("â Error while adding company:",e)}};return(0,r.jsx)(c.Z,{children:(0,r.jsx)(s.default,{children:(0,r.jsx)(o.Z,{onSubmit:a})})})}},28646:function(e,a,n){"use strict";var r=n(85893),o=n(41664),s=n.n(o),l=n(11163);n(67294),a.Z=()=>{let e=(0,l.useRouter)(),a=e.asPath;return(0,r.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,r.jsx)("br",{}),(0,r.jsx)(s(),{className:"text-blue-500",href:"/login?re_url=".concat(a),children:"Click here to Login"})]})}},74857:function(e,a,n){"use strict";var r=n(85893),o=n(67294);a.Z=e=>{let{initialData:a=null,onSubmit:n}=e,[s,l]=(0,o.useState)({company_name:"",company_email:"",no_of_employees:"",address:"",company_mobile_number:"",logo_url:""}),[t,m]=(0,o.useState)({});(0,o.useEffect)(()=>{a&&l(a)},[a]);let c=e=>{let{name:a,value:n}=e.target;l(e=>({...e,[a]:n})),m(e=>({...e,[a]:""}))},d=()=>{let e={};return s.company_name.trim()||(e.company_name="Company name is required."),s.company_email.trim()?/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(s.company_email)||(e.company_email="Invalid email format."):e.company_email="Email is required.",s.no_of_employees||(e.no_of_employees="No. of employees is required."),s.address.trim()||(e.address="Address is required."),s.company_mobile_number.trim()?/^\d{10,15}$/.test(s.company_mobile_number)||(e.company_mobile_number="Enter a valid mobile number (10-15 digits)."):e.company_mobile_number="Mobile number is required.",s.logo_url.trim()||(e.logo_url="Logo URL is required."),m(e),0===Object.keys(e).length};return(0,r.jsxs)("form",{onSubmit:e=>{e.preventDefault(),d()&&n(s)},className:"w-full bg-white p-8 rounded-2xl shadow-md border border-gray-100",children:[(0,r.jsx)("h2",{className:"text-2xl font-semibold mb-6 text-gray-800",children:a?"Update Company":"Add New Company"}),(0,r.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"block text-sm font-medium mb-1 text-gray-700",children:"Company Name"}),(0,r.jsx)("input",{type:"text",name:"company_name",value:s.company_name,onChange:c,className:"w-full max-w-lg border ".concat(t.company_name?"border-red-500":"border-gray-300"," rounded-lg px-3 py-2 focus:ring-2 focus:ring-blue-500 focus:outline-none")}),t.company_name&&(0,r.jsx)("p",{className:"text-red-500 text-sm mt-1",children:t.company_name})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"block text-sm font-medium mb-1 text-gray-700",children:"Email"}),(0,r.jsx)("input",{type:"email",name:"company_email",value:s.company_email,onChange:c,className:"w-full max-w-lg border ".concat(t.company_email?"border-red-500":"border-gray-300"," rounded-lg px-3 py-2 focus:ring-2 focus:ring-blue-500 focus:outline-none")}),t.company_email&&(0,r.jsx)("p",{className:"text-red-500 text-sm mt-1",children:t.company_email})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"block text-sm font-medium mb-1 text-gray-700",children:"No. of Employees"}),(0,r.jsx)("input",{type:"number",name:"no_of_employees",value:s.no_of_employees,onChange:c,className:"w-full max-w-lg border ".concat(t.no_of_employees?"border-red-500":"border-gray-300"," rounded-lg px-3 py-2 focus:ring-2 focus:ring-blue-500 focus:outline-none")}),t.no_of_employees&&(0,r.jsx)("p",{className:"text-red-500 text-sm mt-1",children:t.no_of_employees})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"block text-sm font-medium mb-1 text-gray-700",children:"Mobile Number"}),(0,r.jsx)("input",{type:"text",name:"company_mobile_number",value:s.company_mobile_number,onChange:c,className:"w-full max-w-lg border ".concat(t.company_mobile_number?"border-red-500":"border-gray-300"," rounded-lg px-3 py-2 focus:ring-2 focus:ring-blue-500 focus:outline-none")}),t.company_mobile_number&&(0,r.jsx)("p",{className:"text-red-500 text-sm mt-1",children:t.company_mobile_number})]}),(0,r.jsxs)("div",{className:"md:col-span-2",children:[(0,r.jsx)("label",{className:"block text-sm font-medium mb-1 text-gray-700",children:"Address"}),(0,r.jsx)("input",{type:"text",name:"address",value:s.address,onChange:c,className:"w-full max-w-lg border ".concat(t.address?"border-red-500":"border-gray-300"," rounded-lg px-3 py-2 focus:ring-2 focus:ring-blue-500 focus:outline-none")}),t.address&&(0,r.jsx)("p",{className:"text-red-500 text-sm mt-1",children:t.address})]}),(0,r.jsxs)("div",{className:"md:col-span-2",children:[(0,r.jsx)("label",{className:"block text-sm font-medium mb-1 text-gray-700",children:"Logo URL"}),(0,r.jsx)("input",{type:"text",name:"logo_url",value:s.logo_url,onChange:c,className:"w-full max-w-lg border ".concat(t.logo_url?"border-red-500":"border-gray-300"," rounded-lg px-3 py-2 focus:ring-2 focus:ring-blue-500 focus:outline-none")}),t.logo_url&&(0,r.jsx)("p",{className:"text-red-500 text-sm mt-1",children:t.logo_url})]})]}),(0,r.jsx)("div",{className:"mt-8",children:(0,r.jsx)("button",{type:"submit",className:"bg-blue-600 text-white px-6 py-2.5 rounded-lg font-medium shadow-md hover:bg-blue-700 transition-colors duration-200",children:a?"Update Company":"Add Company"})})]})}},11846:function(e,a,n){"use strict";n.d(a,{Z:function(){return t}});var r=n(85893),o=n(48583),s=n(94543),l=n(28646);function t(e){let{children:a}=e,n=(0,o.Dv)(s.ZP);return n.isLoggedIn?a:(0,r.jsx)(l.Z,{})}}},function(e){e.O(0,[9774,2888,179],function(){return e(e.s=89427)}),_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.