1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3859],{52058:(e,s,r)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/lawyers",function(){return r(93203)}])},93203:(e,s,r)=>{"use strict";r.r(s),r.d(s,{default:()=>k});var n=r(37876),l=r(14232),i=r(25429),o=r(88392),a=r(79736),t=r(51362),c=r(91921),d=r(59803),x=r(18387),h=r(99430),u=r(39955),j=r(53869),g=r(46676),f=r(96491),p=r(84878),y=r(38890),m=r(60851),b=r(99407),S=r(63973),z=r(2665),v=r(55791),w=r(43043),_=r(64435),E=r(17523),T=r(23031),N=r(83679),C=r(66849);let D="#D78049";function W(e){let{label:s,value:r,icon:l,color:h=D,sub:u}=e;return(0,n.jsx)(i.Z,{borderRadius:"xl",boxShadow:"sm",border:"1px solid",borderColor:"gray.100",bg:"white",children:(0,n.jsx)(o.b,{p:5,children:(0,n.jsxs)(a.z,{justify:"space-between",align:"flex-start",children:[(0,n.jsxs)(t.T,{align:"flex-start",spacing:.5,children:[(0,n.jsx)(c.E,{fontSize:"xs",color:"gray.500",textTransform:"uppercase",fontWeight:600,letterSpacing:"wider",children:s}),(0,n.jsx)(c.E,{fontSize:"2xl",fontWeight:"bold",color:"gray.800",children:r}),u&&(0,n.jsx)(c.E,{fontSize:"xs",color:"gray.400",children:u})]}),(0,n.jsx)(d.s,{w:"44px",h:"44px",borderRadius:"xl",bg:"".concat(h,"20"),align:"center",justify:"center",flexShrink:0,children:(0,n.jsx)(x.I,{as:l,color:h,boxSize:5})})]})})})}function k(){var e,s,r;let[i,o]=(0,l.useState)(null),[k,R]=(0,l.useState)(!0),[M,I]=(0,l.useState)(""),[A,P]=(0,l.useState)(""),[L,O]=(0,l.useState)(""),[X,B]=(0,l.useState)(1),F=(0,l.useCallback)(async function(){let{silent:e=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e||R(!0);try{let e=localStorage.getItem("adminToken"),s=new URLSearchParams({page:String(X),limit:"20"});M&&s.set("search",M),A&&s.set("state",A),L&&s.set("onboarded",L);let r=await fetch("/api/admin/lawyers?".concat(s),{headers:{Authorization:"Bearer ".concat(e)},cache:"no-store"});if(401===r.status)return void window.dispatchEvent(new Event("adminForceLogout"));let n=await r.json();o(n)}catch(e){}finally{R(!1)}},[X,M,A,L]);(0,l.useEffect)(()=>{F()},[F]);let J=()=>{B(1),F()};return(0,n.jsx)(C.A,{title:"Lawyer Management",children:(0,n.jsxs)(t.T,{spacing:5,align:"stretch",children:[(null==i?void 0:i.stats)&&(0,n.jsxs)(h.r,{columns:{base:2,md:3,lg:5},spacing:4,children:[(0,n.jsx)(W,{label:"Total Lawyers",value:i.stats.total,icon:N.YXz}),(0,n.jsx)(W,{label:"Onboarded",value:i.stats.onboarded,icon:N.BAG,color:"#38A169"}),(0,n.jsx)(W,{label:"Incomplete",value:i.stats.incomplete,icon:N.NPF,color:"#E53E3E"}),(0,n.jsx)(W,{label:"Draft Sessions",value:null!=(s=i.stats.total_drafts)?s:"â",icon:N.t69,color:"#805AD5",sub:"across all lawyers"}),(0,n.jsx)(W,{label:"Drive Files",value:null!=(r=i.stats.total_drive)?r:"â",icon:N.M1W,color:"#D69E2E",sub:"uploaded documents"})]}),(0,n.jsx)(u.a,{bg:"white",p:4,borderRadius:"xl",boxShadow:"sm",border:"1px solid",borderColor:"gray.100",children:(0,n.jsxs)(a.z,{spacing:4,flexWrap:"wrap",children:[(0,n.jsxs)(j.MJ,{maxW:"260px",children:[(0,n.jsx)(g.l,{fontSize:"sm",children:"Search"}),(0,n.jsx)(f.p,{placeholder:"Name, email, enrollment noâ¦",value:M,onChange:e=>I(e.target.value),onKeyDown:e=>"Enter"===e.key&&J(),size:"sm",borderRadius:"lg"})]}),(0,n.jsxs)(j.MJ,{maxW:"180px",children:[(0,n.jsx)(g.l,{fontSize:"sm",children:"State"}),(0,n.jsx)(f.p,{placeholder:"e.g. Maharashtra",value:A,onChange:e=>P(e.target.value),size:"sm",borderRadius:"lg"})]}),(0,n.jsxs)(j.MJ,{maxW:"160px",children:[(0,n.jsx)(g.l,{fontSize:"sm",children:"Status"}),(0,n.jsxs)(p.l,{value:L,onChange:e=>O(e.target.value),placeholder:"All",size:"sm",borderRadius:"lg",children:[(0,n.jsx)("option",{value:"true",children:"Onboarded"}),(0,n.jsx)("option",{value:"false",children:"Incomplete"})]})]}),(0,n.jsx)(y.$,{onClick:J,bg:D,color:"white",size:"sm",_hover:{bg:"#E8915A"},mt:6,borderRadius:"lg",leftIcon:(0,n.jsx)(N.KSO,{}),children:"Filter"})]})}),(0,n.jsx)(u.a,{bg:"white",borderRadius:"xl",boxShadow:"sm",border:"1px solid",borderColor:"gray.100",overflow:"hidden",children:k?(0,n.jsx)(d.s,{justify:"center",align:"center",py:12,children:(0,n.jsx)(m.y,{color:D,size:"lg"})}):(null==i||null==(e=i.lawyers)?void 0:e.length)?(0,n.jsx)(u.a,{overflowX:"auto",children:(0,n.jsxs)(b.X,{size:"sm",variant:"simple",children:[(0,n.jsx)(S.d,{bg:"gray.50",children:(0,n.jsxs)(z.Tr,{children:[(0,n.jsx)(v.Th,{py:3,fontSize:"xs",children:"Name"}),(0,n.jsx)(v.Th,{py:3,fontSize:"xs",children:"Phone"}),(0,n.jsx)(v.Th,{py:3,fontSize:"xs",children:"Bar Council"}),(0,n.jsx)(v.Th,{py:3,fontSize:"xs",children:"Location"}),(0,n.jsx)(v.Th,{py:3,fontSize:"xs",children:"Status"}),(0,n.jsx)(v.Th,{py:3,fontSize:"xs",isNumeric:!0,children:"Cases"}),(0,n.jsx)(v.Th,{py:3,fontSize:"xs",isNumeric:!0,children:"Drafts"}),(0,n.jsx)(v.Th,{py:3,fontSize:"xs",isNumeric:!0,children:"Drive"}),(0,n.jsx)(v.Th,{py:3,fontSize:"xs",children:"Joined"})]})}),(0,n.jsx)(w.N,{children:i.lawyers.map(e=>{var s,r;return(0,n.jsxs)(z.Tr,{_hover:{bg:"gray.50"},children:[(0,n.jsx)(_.Td,{py:3,children:(0,n.jsxs)(t.T,{align:"flex-start",spacing:0,children:[(0,n.jsx)(c.E,{fontSize:"sm",fontWeight:500,children:e.full_name||"â"}),(0,n.jsx)(c.E,{fontSize:"xs",color:"gray.400",children:e.email})]})}),(0,n.jsx)(_.Td,{py:3,fontSize:"sm",color:"gray.600",children:e.phone||"â"}),(0,n.jsx)(_.Td,{py:3,children:(0,n.jsxs)(t.T,{align:"flex-start",spacing:0,children:[(0,n.jsx)(c.E,{fontSize:"xs",color:"gray.700",children:e.state_bar_council||"â"}),e.enrollment_number&&(0,n.jsx)(c.E,{fontSize:"xs",color:"gray.400",children:e.enrollment_number})]})}),(0,n.jsx)(_.Td,{py:3,children:(0,n.jsx)(c.E,{fontSize:"xs",color:"gray.600",children:[e.office_city,e.office_state].filter(
1Boolean).join(", ")||"â"})}),(0,n.jsx)(_.Td,{py:3,children:e.onboarding_completed?(0,n.jsx)(E.E,{colorScheme:"green",borderRadius:"full",px:2,fontSize:"xs",children:"Onboarded"}):(0,n.jsx)(T.m,{label:"Step ".concat(null!=(s=e.onboarding_step)?s:0),children:(0,n.jsxs)(E.E,{colorScheme:"orange",borderRadius:"full",px:2,fontSize:"xs",children:["Step ",null!=(r=e.onboarding_step)?r:0]})})}),(0,n.jsx)(_.Td,{py:3,isNumeric:!0,children:(0,n.jsxs)(a.z,{justify:"flex-end",spacing:1,children:[(0,n.jsx)(x.I,{as:N.PMT,boxSize:3,color:"gray.400"}),(0,n.jsx)(c.E,{fontSize:"sm",fontWeight:e.case_count>0?600:400,color:e.case_count>0?"gray.800":"gray.400",children:e.case_count})]})}),(0,n.jsx)(_.Td,{py:3,isNumeric:!0,children:(0,n.jsxs)(a.z,{justify:"flex-end",spacing:1,children:[(0,n.jsx)(x.I,{as:N.t69,boxSize:3,color:"gray.400"}),(0,n.jsx)(c.E,{fontSize:"sm",fontWeight:e.draft_count>0?600:400,color:e.draft_count>0?"purple.600":"gray.400",children:e.draft_count})]})}),(0,n.jsx)(_.Td,{py:3,isNumeric:!0,children:(0,n.jsxs)(a.z,{justify:"flex-end",spacing:1,children:[(0,n.jsx)(x.I,{as:N.M1W,boxSize:3,color:"gray.400"}),(0,n.jsx)(c.E,{fontSize:"sm",fontWeight:e.drive_count>0?600:400,color:e.drive_count>0?"yellow.700":"gray.400",children:e.drive_count})]})}),(0,n.jsx)(_.Td,{py:3,children:(0,n.jsx)(c.E,{fontSize:"xs",color:"gray.500",children:new Date(e.created_at).toLocaleDateString("en-IN",{day:"2-digit",month:"short",year:"2-digit"})})})]},e.id)})})]})}):(0,n.jsx)(u.a,{p:10,textAlign:"center",children:(0,n.jsx)(c.E,{color:"gray.400",children:"No lawyers found"})})}),i&&i.pages>1&&(0,n.jsx)(d.s,{justify:"center",children:(0,n.jsxs)(a.z,{spacing:2,children:[(0,n.jsx)(y.$,{size:"xs",onClick:()=>B(e=>Math.max(e-1,1)),isDisabled:1===X,variant:"outline",children:"â Prev"}),(0,n.jsxs)(c.E,{fontSize:"sm",color:"gray.600",children:["Page ",X," of ",i.pages]}),(0,n.jsx)(y.$,{size:"xs",onClick:()=>B(e=>Math.min(e+1,i.pages)),isDisabled:X===i.pages,variant:"outline",children:"Next â"})]})})]})})}}},e=>{var s=s=>e(e.s=s);e.O(0,[4938,3615,4587,9853,6849,636,6593,8792],()=>s(52058)),_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.