PageSourceSearch

https://harishkotra.me/_next/static/chunks/pages/company/[companyName]/teams/[teamSlug]-febcb0304f10cb01.js

js harishkotra.me collected 2026-09-30 17:38:10 UTC 5,589 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2526],{59148:(e,a,l)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/company/[companyName]/teams/[teamSlug]",function(){return l(63510)}])},63510:(e,a,l)=>{"use strict";l.r(a),l.d(a,{default:()=>A});var s=l(37876),t=l(2171),n=l(14232),r=l(48230),i=l.n(r),o=l(89099),m=l(34217),c=l(58385),d=l(83872),u=l(21639),p=l(88913),h=l(71297),g=l(78964),y=l(34321),b=l(11023),x=l(68827),f=l(48187),v=l(95726),j=l(87755),N=l(25450),w=l(78747);let A=()=>{var e,a,l,r,g,b,f,A;let T=(0,t.useDispatch)(),{company:C}=(0,t.useSelector)(e=>e.Company),{teams:E}=(0,t.useSelector)(e=>e.Teams),[k,M]=(0,n.useState)(""),[_,P]=(0,n.useState)(!1),[O,q]=(0,n.useState)(!1),[I,z]=(0,n.useState)({}),[D,R]=(0,n.useState)([]),[B,L]=(0,n.useState)(!0),F=(0,o.useRouter)(),{teamSlug:H,companyName:X}=F.query,Y=(null==(e=Object.keys(C))?void 0:e.length)>0&&(null==C?void 0:C.profileHandle)===X,G=(null==F||null==(a=F.query)?void 0:a.page)?parseInt(F.query.page,10):1;(0,n.useEffect)(()=>{F.isReady&&U()},[F.isReady,G]),(0,n.useEffect)(()=>{!E.length||(null==I?void 0:I.id)||z(E.find(e=>e.slug===H))},[E]);let U=async()=>
1{try{L(!0);let e=await y.gz.getTeamMembers("chandle=".concat(X,"&slug=").concat(H,"&page=").concat(G));z(e.data.data)}catch(e){}finally{L(!1)}};(0,n.useEffect)(()=>{L(!0);let e=setTimeout(async()=>{if(k){var e;let a=await y.gz.getTeamMembers("query=".concat(k,"&slug=").concat(H)),{members:l}=(null==a||null==(e=a.data)?void 0:e.data)||[];R(l)}L(!1)},500);return()=>{clearTimeout(e),L(!1)}},[k]);let W=async e=>{let a={members:[e],teamId:I.id};try{await y.gz.removeMembersFromTeam(a),z(a=>({...a,members:a.members.filter(a=>a.id!==e)})),D&&R(a=>a.filter(a=>a.id!==e)),T(N.WM.updateTeams({teams:E.map(a=>{if(a.id===I.id){var l,s;return{...a,members:(null==(l=a.members)?void 0:l.length)?a.members.filter(a=>a.id!==e):[],memberCount:(null==I||null==(s=I.members)?void 0:s.length)?parseInt(I.members.length-1,10):0}}return a})}))}catch(e){h.A.ErrorToast(x.A.GLOBAL.wrong)}},J=(null==I||null==(l=I.company)?void 0:l.name)||"",K=(null==I?void 0:I.name)||"",Q="";J&&K&&(Q="".concat(J,": ").concat(K)),!J&&K&&(Q=K);let V={};return(null==I||null==(r=I.company)?void 0:r.id)&&
1(V={title:Q,description:(null==I?void 0:I.description)||""}),(0,s.jsxs)(w.A,{companyData:(null==I?void 0:I.company)||{},pageMetaData:V,pageProp:{showBackButton:!0,heading:"".concat(Q),centerTopOptions:Y?(0,s.jsxs)("div",{className:"hidden sm:flex items-center justify-between w-full sm:max-w-fit sm:justify-start mt-2 sm:mt-0",children:[(0,s.jsx)(u.Ay.CarbonOutline,{onClick:()=>P(e=>!e),small:!0,className:"mr-2",children:"Edit"}),(0,s.jsx)(u.Ay.Carbon,{onClick:()=>q(e=>!e),small:!0,iconLeft:(0,s.jsx)(d.PlusIcon,{size:16}),children:"Teammate"})]}):null},children:[(0,s.jsxs)("div",{className:"relative h-full",children:[(null==I||null==(g=I.members)?void 0:g.length)||B?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"grid sm:grid-cols-2 grid-cols-1 lg:px-6 lg:pt-4 px-4 pt-4 gap-4",children:(0,s.jsx)(v.Ay,{value:k,onChange:e=>M(e.target.value),type:"search",placeholder:"Search members",icon:(0,s.jsx)(d.SearchIcon,{size:18})})}),(0,s.jsx)(S,{list:k.length?D:I.members,onRemoveMember:W,isAdmin:Y,loading:B})]}):(0,s.jsx)(m.A.EmptyState,{icon:(0,s.jsx)(c.A.NoTeamMembers,{}),title:"There is no one in this team!",description:"You can add members who have a verified association with your company.",body:(0,s.jsx)(u.Ay.Carbon,{onClick:()=>q(e=>!e),small:!0,className:"mt-4",iconLeft:(0,s.jsx)(d.PlusIcon,{size:16}),children:"Teammate"})}),(null==I||null==(b=I.members)?void 0:b.length)>0&&(0,s.jsxs)("div",{className:"flex items-center justify-between p-4 sm:p-6 w-full absolute bottom-20 lg:bottom-0",children:[(0,s.jsx)(u.Ay.CarbonOutline,{small:!0,"aria-label":"Previous page",className:G<=1?"cursor-not-allowed opacity-50":"",as:i(),href:{pathname:F.pathname,query:{page:G<=1?1:G-1,teamSlug:null==F||null==(f=F.query)?void 0:f.teamSlug,companyName:null==F||null==(A=F.query)?void 0:A.companyName}},children:"Previous"}),(0,s.jsx)(u.Ay.CarbonOutline,{small:!0,"aria-label":"Next page",as:I.isNextPage?i():"div",className:I.isNextPage?"":"cursor-not-allowed opacity-50",...I.isNextPage?{href:{pathname:F.pathname,query:{page:G+1,teamSlug:H,companyName:X}}}:{},children:"Next"})]})]}),_&&(0,s.jsx)(p.A,{showModal:_,setShowModal:P,isEditing:!0,currentTeamData:I}),O&&(0,s.jsx)(j.A,{showModal:O,setShowModal:q,team:I,callback:e=>{let{membersAdded:a}=e;(null==a?void 0:a.length)&&z(e=>{var l;return{...e,members:(null==(l=e.members)?void 0:l.length)?[...e.members,...a]:a}})}})]})},S=e=>{let{list:a,onRemoveMember:l,isAdmin:t,loading:n}=e;return(0,s.jsx)("div",{className:"p-4 sm:p-6 mb-48 lg:mb-24",children:(null==a?void 0:a.length)||n>0?(0,s.jsx)("ul",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:n?[,,,,].fill(null).map((e,a)=>(0,s.jsx)(f.A.UserProfileCardSkeleton,{},"team-person-profile-".concat(a+1))):a.map(e=>(0,s.jsx)("li",{children:(0,s.jsx)(g.A.TeamMemberCard,{user:e,className:"border border-primaryBorder",dropDownOptions:t?(0,s.jsxs)(b.e.Item,{className:"text-xs flex items-center",onClick:()=>l(e.id),children:[(0,s.jsx)(d.TrashIcon,{size:18}),(0,s.jsx)("span",{className:"ml-1",children:"Remove from Team"})]}):""})},null==e?void 0:e.profileHandle))}):(0,s.jsx)(m.A.EmptyState,{icon:(0,s.jsx)(c.A.EmptySearch,{}),title:"Couldn’t find them!",description:"You can find people by first/last name, and if your search keyword is available in their bio."})})}}},e=>{e.O(0,[5389,1889,8747,636,6593,8792],()=>e(e.s=59148)),_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.