PageSourceSearch

https://redgo.in/assets/js/AddEmployee-DAx1kpFl.js

js redgo.in collected 2026-09-24 15:04:10 UTC 8,942 bytes, 1 lines download raw bytes

1import{c as j,r as d,j as e}from"./index-Cf_ajVON.js";import{U as m}from"./user-hoYoq1t7.js";import{C as c}from"./chevron-down-DvOvGc9V.js";import{U as v}from"./upload-BhkmleXG.js";import{E as x}from"./eye-off-CoDAbRMZ.js";import{E as u}from"./eye-DP9IZTXG.js";const N=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]],w=j("user-plus",N);function S(){const[o,h]=d.useState(!1),[r,p]=d.useState(!1),[l,n]=d.useState({firstName:"",lastName:"",zone:"All",role:"",phone:"",phoneCode:"+91",employeeImage:null,email:"",password:"",confirmPassword:""}),t=(s,a)=>{n(i=>({...i,[s]:a}))},b=(s,a)=>{a&&n(i=>({...i,[s]:a}))},g=s=>{s.preventDefault(),alert("Employee added successfully!")},f=()=>{n({firstName:"",lastName:"",zone:"All",role:"",phone:"",phoneCode:"+91",employeeImage:null,email:"",password:"",confirmPassword:""})};return e.jsx("div",{className:"p-4 lg:p-6 bg-slate-50 min-h-screen",children:e.jsxs("div",{className:"max-w-7xl mx-auto",children:[e.jsx("div",{className:"bg-white rounded-xl shadow-sm border border-slate-200 p-6 mb-6",children:e.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[e.jsx("div",{className:"w-10 h-10 rounded-lg bg-blue-600 flex items-center justify-center",children:e.jsx(w,{className:"w-5 h-5 text-white"})}),e.jsx("h1",{className:"text-2xl font-bold text-slate-900",children:"Add New Employee"})]})}),e.jsxs("form",{onSubmit:g,children:[e.jsxs("div",{className:"bg-white rounded-xl shadow-sm border border-slate-200 p-6 mb-6",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[e.jsx(m,{className:"w-5 h-5 text-slate-600"}),e.jsx("h2",{className:"text-lg font-semibold text-slate-900",children:"General Information"})]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[e.jsxs("div",{className:"lg:col-span-2 space-y-6",children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-semibold text-slate-700 mb-2",children:"First name"}),e.jsx("input",{type:"text",value:l.firstName,onChange:s=>t("firstName",s.target.value),placeholder:"Ex: John",className:"w-full px-4 py-2.5 border border-slate-300 rounded-lg bg-white focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 text-sm"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-semibold text-slate-700 mb-2",children:"Last name"}),e.jsx("input",{type:"text",value:l.lastName,onChange:s=>t("lastName",s.target.value),placeholder:"Ex: Doe",className:"w-full px-4 py-2.5 border border-slate-300 rounded-lg bg-white focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 text-sm"})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-semibold text-slate-700 mb-2",children:"Zone"}),e.jsxs("div",{className:"relative",children:[e.jsxs("select",{value:l.zone,onChange:s=>t("zone",s.target.value),className:"w-full px-4 py-2.5 pr-8 border border-slate-300 rounded-lg bg-white focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 text-sm appearance-none cursor-pointer",children:[e.jsx("option",{value:"All",children:"All"}),e.jsx("option",{value:"Zone 1",children:"Zone 1"}),e.jsx("option",{value:"Zone 2",children:"Zone 2"}),e.jsx("option",{value:"Zone 3",children:"Zone 3"})]}),e.jsx(c,{className:"absolute right-2 top-1/2 -translate-y-1/2 w-4 h-4 text-slate-500 pointer-events-none"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-semibold text-slate-700 mb-2",children:"Role"}),e.jsxs("div",{className:"relative",children:[e.jsxs("select",{value:l.role,onChange:s=>t("role",s.target.value),className:"w-full px-4 py-2.5 pr-8 border border-slate-300 rounded-lg bg-white focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 text-sm appearance-none cursor-pointer",children:[e.jsx("option",{value:"",children:"Select Role"}),e.jsx("option",{value:"manager",children:"Manager"}),e.jsx("option",{value:"customer-care",children:"Customer Care Executive"}),e.jsx("option",{value:"admin",children:"Admin"})]}),e.jsx(c,{className:"absolute right-2 top-1/2 -translate-y-1/2 w-4 h-4 text-slate-500 pointer-events-none"})]})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-semibold text-slate-700 mb-2",children:"Phone"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("div",{className:"relative",children:[e.jsx("select",{value:l.phoneCode,onChange:s=>t("phoneCode",s.target.value),className:"px-4 py-2.5 pr-8 border border-slate-300 rounded-lg bg-white focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 text-sm appearance-none cursor-pointer",children:e.jsx("option",{value:"+91",children:"🇮🇳 +91"})}),e.jsx(c,{className:"absolute right-2 top-1/2 -translate-y-1/2 w-4 h-4 text-slate-500 pointer-events-none"})]}),e.jsx("input",{type:"tel",value:l.phone,onChange:s=>t("phone",s.target.value),placeholder:"Phone number",className:"flex-1 px-4 py-2.5 border border-slate-300 rounded-lg bg-white focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 text-sm"})]})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-semibold text-slate-700 mb-2",children:"Employee image"}),e.jsxs("div",{className:"border-2 border-dashed border-slate-300 rounded-lg p-8 text-center hover:border-blue-500 transition-colors cursor-pointer",children:[e.jsx("input",{type:"file",accept:"image/jpeg,image/jpg,image/png,image/gif",onChange:s=>b("employeeImage",s.target.files[0]),className:"hidden",id:"employee-image-upload"}),e.jsxs("label",{htmlFor:"employee-image-upload",className:"cursor-pointer",children:[e.jsx(v,{className:"w-12 h-12 text-slate-400 mx-auto mb-3"}),e.jsx("p",{className:"text-sm font-medium text-slate-700 mb-1",children:"Upload Image"}),e.jsxs("div",{className:"text-xs text-slate-500 space-y-1 mt-2",children:[e.jsx("p",{children:"Image format - jpg png jpeg gif"}),e.jsx("p",{children:"Image Size - maximum size 2 MB"}),e.jsx("p",{children:"Image Ratio - 1:1"})]})]})]})]})]})]}),e.jsxs("div",{className:"bg-white rounded-xl shadow-sm border border-slate-200 p-6 mb-6",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[e.jsx(m,{className:"w-5 h-5 text-slate-600"}),e.jsx("h2",{className:"text-lg font-semibold text-slate-900",children:"Account Info"})]}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-semibold text-slate-700 mb-2",children:"Email"}),e.jsx("input",{type:"email",value:l.email,onChange:s=>t("email",s.target.value),placeholder:"Ex: [email protected]",className:"w-full px-4 py-2.5 border border-slate-300 rounded-lg bg-white focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 text-sm"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-semibold text-slate-700 mb-2",children:"Password"}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{type:o?"text":"password",value:l.password,onChange:s=>t("password",s.target.value),placeholder:"Password length 8+",className:"w-full px-4 py-2.5 pr-10 border border-slate-300 rounded-lg bg-white focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 text-sm"}),e.jsx("button",{type:"button",onClick:()=>h(!o),className:"absolute right-3 top-1/2 -translate-y-1/2 text-slate-400 hover:text-slate-600",children:o?e.jsx(x,{className:"w-4 h-4"}):e.jsx(u,{className:"w-4 h-4"})})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-semibold text-slate-700 mb-2",children:"Confirm Password"}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{type:r?"text":"password",value:l.confirmPassword,onChange:s=>t("confirmPassword",s.target.value),placeholder:"Password length 8+",className:"w-full px-4 py-2.5 pr-10 border border-slate-300 rounded-lg bg-white focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 text-sm"}),e.jsx("button",{type:"button",onClick:()=>p(!r),className:"absolute right-3 top-1/2 -translate-y-1/2 text-slate-400 hover:text-slate-600",children:r?e.jsx(x,{className:"w-4 h-4"}):e.jsx(u,{className:"w-4 h-4"})})]})]})]})]}),e.jsxs("div",{className:"flex items-center justify-end gap-4 mb-6",children:[e.jsx("button",{type:"button",onClick:f,className:"px-6 py-2.5 text-sm font-medium rounded-lg border border-slate-300 bg-white text-slate-700 hover:bg-slate-50 transition-all",children:"Reset"}),e.jsx("button",{type:"submit",className:"px-6 py-2.5 text-sm font-medium rounded-lg bg-blue-600 text-white hover:bg-blue-700 transition-all shadow-md",children:"Submit"})]})]})]})})}export{S as default};

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.