PageSourceSearch

https://redgo.in/assets/js/EmployeeList-D5AxqTil.js

js redgo.in collected 2026-10-02 01:58:28 UTC 10,135 bytes, 1 lines download raw bytes

1import{r,j as e}from"./index-CAG7YFZd.js";import{D as S,a as k,b as D,c as A,d as M,e as d}from"./dropdown-menu-CfBNnlBC.js";import{D as F,a as L,d as O,b as P}from"./dialog-GAffG_et.js";import{U as p}from"./users-CLLF94FG.js";import{S as T}from"./search-B8wRtotC.js";import{D as z}from"./download-DJSvN6gr.js";import{C as I}from"./chevron-down-C3dIF40-.js";import{F as h}from"./file-text-7Q36_7-K.js";import{F as U}from"./file-spreadsheet-CLzZZJ2P.js";import{C as V}from"./code-BaqM25-r.js";import{S as u}from"./settings-Dn_VLM_1.js";import{A as l}from"./arrow-up-down-CvQMiJ_L.js";import{S as q}from"./square-pen-CEf7Xw1F.js";import{T as J}from"./trash-2-Qyy0Wnny.js";import{C as Q}from"./columns-2-BgxSlXJz.js";import{C as R}from"./check-ww-GHu8x.js";import"./index-QHXycSr2.js";import"./index-CBAjRXir.js";import"./index-CHqH92X0.js";import"./index-r6P5ANRq.js";import"./index-Cf6hN_Fs.js";import"./tslib.es6-CwyXKlH1.js";import"./index-DnCL3ZlK.js";import"./index-Dc0kaaFU.js";import"./index-gW1jScX8.js";import"./chevron-right-DFSfj0ll.js";import"./x-BCVCJpKG.js";const $=[{id:1,name:"Jhon",phone:"+81234567890",email:"[email protected]",createdAt:"07 Feb, 2023"},{id:2,name:"Monali Khan",phone:"+81234567891",email:"[email protected]",createdAt:"22 Aug, 2021"}];function be(){const[n,j]=r.useState(""),[o,f]=r.useState($),[N,m]=r.useState(!1),[t,x]=r.useState({si:!0,name:!0,phone:!0,email:!0,createdAt:!0,actions:!0}),i=r.useMemo(()=>{if(!n.trim())return o;const s=n.toLowerCase().trim();return o.filter(a=>a.name.toLowerCase().includes(s)||a.email.toLowerCase().includes(s))},[o,n]),b=s=>s?s.length>2?s.slice(0,2)+"*".repeat(s.length-2):s:"",g=s=>{if(!s)return"";const[a,E]=s.split("@");return a.length>1?`${a[0]+"*".repeat(a.length-1)}@${E}`:s},w=s=>{window.confirm("Are you sure you want to delete this employee?")&&f(o.filter(a=>a.id!==s))},c=s=>{if(i.length===0){alert("No data to export");return}},v=s=>{x(a=>({...a,[s]:!a[s]}))},y=()=>{x({si:!0,name:!0,phone:!0,email:!0,createdAt:!0,actions:!0})},C={si:"Serial Number",name:"Employee Name",phone:"Phone",email:"Email",createdAt:"Created At",actions:"Actions"};return e.jsxs("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(p,{className:"w-5 h-5 text-white"})}),e.jsx("h1",{className:"text-2xl font-bold text-slate-900",children:"Employee List"})]})}),e.jsxs("div",{className:"bg-white rounded-xl shadow-sm border border-slate-200 p-6",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4 mb-6",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(p,{className:"w-5 h-5 text-slate-600"}),e.jsx("h2",{className:"text-xl font-bold text-slate-900",children:"Employee List"}),e.jsx("span",{className:"px-3 py-1 rounded-full text-sm font-semibold bg-slate-100 text-slate-700",children:i.length})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("div",{className:"relative flex-1 sm:flex-initial min-w-[250px]",children:[e.jsx("input",{type:"text",placeholder:"Search by name or email",value:n,onChange:s=>j(s.target.value),className:"pl-10 pr-4 py-2.5 w-full text-sm rounded-lg border border-slate-300 bg-white focus:outline-none focus:ring-2 focus:ring-slate-400 focus:border-slate-400"}),e.jsx(T,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-slate-400"})]}),e.jsxs(S,{children:[e.jsx(k,{asChild:!0,children:e.jsxs("button",{className:"px-4 py-2.5 text-sm font-medium rounded-lg border border-slate-300 bg-white hover:bg-slate-50 text-slate-700 flex items-center gap-2 transition-all",children:[e.jsx(z,{className:"w-4 h-4"}),e.jsx("span",{className:"text-black font-bold",children:"Export"}),e.jsx(I,{className:"w-3 h-3"})]})}),e.jsxs(D,{align:"end",className:"w-56 bg-white border border-slate-200 rounded-lg shadow-lg z-50 animate-in fade-in-0 zoom-in-95 duration-200 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",children:[e.jsx(A,{children:"Export Format"}),e.jsx(M,{}),e.jsxs(d,{onClick:()=>c(),className:"cursor-pointer",children:[e.jsx(h,{className:"w-4 h-4 mr-2"}),"Export as CSV"]}),e.jsxs(d,{onClick:()=>c(),className:"cursor-pointer",children:[e.jsx(U,{className:"w-4 h-4 mr-2"}),"Export as Excel"]}),e.jsxs(d,{onClick:()=>c(),className:"cursor-pointer",children:[e.jsx(h,{className:"w-4 h-4 mr-2"}),"Export as PDF"]}),e.jsxs(d,{onClick:()=>c(),className:"cursor-pointer",children:[e.jsx(V,{className:"w-4 h-4 mr-2"}),"Export as JSON"]})]})]}),e.jsx("button",{onClick:()=>m(!0),className:"p-2.5 rounded-lg border border-slate-300 bg-white hover:bg-slate-50 text-slate-700 transition-all",children:e.jsx(u,{className:"w-5 h-5"})})]})]}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full",children:[e.jsx("thead",{className:"bg-slate-50 border-b border-slate-200",children:e.jsxs("tr",{children:[t.si&&e.jsx("th",{className:"px-6 py-4 text-left text-[10px] font-bold text-slate-700 uppercase tracking-wider",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{children:"SI"}),e.jsx(l,{className:"w-3 h-3 text-slate-400 cursor-pointer hover:text-slate-600"})]})}),t.name&&e.jsx("th",{className:"px-6 py-4 text-left text-[10px] font-bold text-slate-700 uppercase tracking-wider",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{children:"Employee Name"}),e.jsx(l,{className:"w-3 h-3 text-slate-400 cursor-pointer hover:text-slate-600"})]})}),t.phone&&e.jsx("th",{className:"px-6 py-4 text-left text-[10px] font-bold text-slate-700 uppercase tracking-wider",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{children:"Phone"}),e.jsx(l,{className:"w-3 h-3 text-slate-400 cursor-pointer hover:text-slate-600"})]})}),t.email&&e.jsx("th",{className:"px-6 py-4 text-left text-[10px] font-bold text-slate-700 uppercase tracking-wider",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{children:"Email"}),e.jsx(l,{className:"w-3 h-3 text-slate-400 cursor-pointer hover:text-slate-600"})]})}),t.createdAt&&e.jsx("th",{className:"px-6 py-4 text-left text-[10px] font-bold text-slate-700 uppercase tracking-wider",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{children:"Created At"}),e.jsx(l,{className:"w-3 h-3 text-slate-400 cursor-pointer hover:text-slate-600"})]})}),t.actions&&e.jsx("th",{className:"px-6 py-4 text-center text-[10px] font-bold text-slate-700 uppercase tracking-wider",children:"Action"})]})}),e.jsx("tbody",{className:"bg-white divide-y divide-slate-100",children:i.length===0?e.jsx("tr",{children:e.jsx("td",{colSpan:Object.values(t).filter(s=>s).length,className:"px-6 py-8 text-center text-slate-500",children:"No employees found"})}):i.map((s,a)=>e.jsxs("tr",{className:"hover:bg-slate-50 transition-colors",children:[t.si&&e.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:e.jsx("span",{className:"text-sm font-medium text-slate-700",children:a+1})}),t.name&&e.jsx("td",{className:"px-6 py-4",children:e.jsx("span",{className:"text-sm font-medium text-slate-900",children:s.name})}),t.phone&&e.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:e.jsx("span",{className:"text-sm text-slate-700",children:b(s.phone)})}),t.email&&e.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:e.jsx("span",{className:"text-sm text-slate-700",children:g(s.email)})}),t.createdAt&&e.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:e.jsx("span",{className:"text-sm text-slate-700",children:s.createdAt})}),t.actions&&e.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-center",children:e.jsxs("div",{className:"flex items-center justify-center gap-2",children:[e.jsx("button",{className:"p-1.5 rounded text-blue-600 hover:bg-blue-50 transition-colors",title:"Edit",children:e.jsx(q,{className:"w-4 h-4"})}),e.jsx("button",{onClick:()=>w(s.id),className:"p-1.5 rounded text-red-600 hover:bg-red-50 transition-colors",title:"Delete",children:e.jsx(J,{className:"w-4 h-4"})})]})})]},s.id))})]})})]})]}),e.jsx(F,{open:N,onOpenChange:m,children:e.jsxs(L,{className:"max-w-md bg-white p-0 o
1pacity-0 data-[state=open]:opacity-100 data-[state=closed]:opacity-0 transition-opacity duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=open]:fade-in-0 data-[state=closed]:fade-out-0 data-[state=open]:scale-100 data-[state=closed]:scale-100",children:[e.jsx(O,{className:"px-6 pt-6 pb-4",children:e.jsxs(P,{className:"flex items-center gap-2",children:[e.jsx(u,{className:"w-5 h-5"}),"Table Settings"]})}),e.jsxs("div",{className:"px-6 pb-6 space-y-4",children:[e.jsxs("div",{children:[e.jsxs("h3",{className:"text-sm font-semibold text-slate-700 mb-3 flex items-center gap-2",children:[e.jsx(Q,{className:"w-4 h-4"}),"Visible Columns"]}),e.jsx("div",{className:"space-y-2",children:Object.entries(C).map(([s,a])=>e.jsxs("label",{className:"flex items-center gap-3 p-2 rounded-lg hover:bg-slate-50 cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:t[s],onChange:()=>v(s),className:"w-4 h-4 text-emerald-600 border-slate-300 rounded focus:ring-emerald-500"}),e.jsx("span",{className:"text-sm text-slate-700",children:a}),t[s]&&e.jsx(R,{className:"w-4 h-4 text-emerald-600 ml-auto"})]},s))})]}),e.jsxs("div",{className:"flex items-center justify-end gap-3 pt-4 border-t border-slate-200",children:[e.jsx("button",{onClick:y,className:"px-4 py-2 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",{onClick:()=>m(!1),className:"px-4 py-2 text-sm font-medium rounded-lg bg-emerald-500 text-white hover:bg-emerald-600 transition-all shadow-md",children:"Apply"})]})]})]})})]})}export{be 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.