PageSourceSearch

https://app.wattfootprint.com/_next/static/chunks/pages/companies/companies-list-a80a531772cefa84.js

js wattfootprint.com collected 2026-10-09 04:46:37 UTC 10,645 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8378],{21023:function(e,t,a){"use strict";var l=a(91941);t.Z=void 0;var n=l(a(64938)),s=a(85893);t.Z=(0,n.default)((0,s.jsx)("path",{d:"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20z"}),"ArrowBack")},93619:function(e,t,a){"use strict";var l=a(91941);t.Z=void 0;var n=l(a(64938)),s=a(85893);t.Z=(0,n.default)((0,s.jsx)("path",{d:"m12 4-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z"}),"ArrowForward")},3874:function(e,t,a){"use strict";var l=a(91941);t.Z=void 0;var n=l(a(64938)),s=a(85893);t.Z=(0,n.default)((0,s.jsx)("path",{d:"M11 21h-1l1-7H7.5c-.88 0-.33-.75-.31-.78C8.48 10.94 10.42 7.54 13.01 3h1l-1 7h3.51c.4 0 .62.19.4.66C12.97 17.55 11 21 11 21"}),"BoltOutlined")},68047:function(e,t,a){"use strict";var l=a(91941);t.Z=void 0;var n=l(a(64938)),s=a(85893);t.Z=(0,n.default)((0,s.jsx)("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m3.59-13L12 10.59 8.41 7 7 8.41 10.59 12 7 15.59 8.41 17 12 13.41 15.59 17 17 15.59 13.41 12 17 8.41z"}),"CancelOutlined")},18967:function(e,t,a){"use strict";var l=a(91941);t.Z=void 0;var n=l(a(64938)),s=a(85893);t.Z=(0,n.default)((0,s.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m4.59-12.42L10 14.17l-2.59-2.58L6 13l4 4 8-8z"}),"CheckCircleOutlined")},81216:function(e,t,a){"use strict";var l=a(91941);t.Z=void 0;var n=l(a(64938)),s=a(85893);t.Z=(0,n.default)((0,s.jsx)("path",{d:"M10 18h4v-2h-4zM3 6v2h18V6zm3 7h12v-2H6z"}),"FilterList")},874:function(e,t,a){"use strict";var l=a(91941);t.Z=void 0;var n=l(a(64938)),s=a(85893);t.Z=(0,n.default)([(0,s.jsx)("path",{d:"M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7M7 9c0-2.76 2.24-5 5-5s5 2.24 5 5c0 2.88-2.88 7.19-5 9.88C9.92 16.21 7 11.85 7 9"},"0"),(0,s.jsx)("circle",{cx:"12",cy:"9",r:"2.5"},"1")],"LocationOnOutlined")},64796:function(e,t,a){"use strict";var l=a(91941);t.Z=void 0;var n=l(a(64938)),s=a(85893);t.Z=(0,n.default)((0,s.jsx)("path",{d:"m6.76 4.84-1.8-1.79-1.41 1.41 1.79 1.79zM1 10.5h3v2H1zM11 .55h2V3.5h-2zm8.04 2.495 1.408 1.407-1.79 1.79-1.407-1.408zm-1.8 15.115 1.79 1.8 1.41-1.41-1.8-1.79zM20 10.5h3v2h-3zm-8-5c-3.31 0-6 2.69-6 6s2.69 6 6 6 6-2.69 6-6-2.69-6-6-6m0 10c-2.21 0-4-1.79-4-4s1.79-4 4-4 4 1.79 4 4-1.79 4-4 4m-1 4h2v2.95h-2zm-7.45-.96 1.41 1.41 1.79-1.8-1.41-1.41z"}),"WbSunnyOutlined")},14680:function(e,t,a){(window.__NEXT_P=window.__NEXT_P||[]).push(["/companies/companies-list",function(){return a(14612)}])},13106:function(e,t,a){"use strict";a.d(t,{Z:function(){return CardBox}});var l=a(85893),n=a(67294);function CardBoxComponentBody(e){let{noPadding:t=!1,className:a,children:n}=e;return(0,l.jsx)("div",{className:"flex-1 ".concat(t?"":"p-6"," ").concat(a),children:n})}function CardBoxComponentFooter(e){let{className:t,children:a}=e;return(0,l.jsx)("footer",{className:"p-6 ".concat(t),children:a})}function CardBox(e){let{rounded:t="rounded-2xl",flex:a="flex-col",className:s="",bodyClassName:i="",bgcolor:o="bg-globalBg2",hasComponentLayout:c=!1,hasTable:r=!1,isHoverable:d=!1,isModal:u=!1,children:m,footer:x,onClick:h}=e,f=[r?"overflow-hidden min-h-0":"overflow-auto","".concat(o," flex"),s,t,a];return d&&f.push("hover:shadow-lg transition-shadow duration-500"),n.createElement("div",{className:f.join(" "),onClick:h},c?m:(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(CardBoxComponentBody,{noPadding:r,className:i,children:m}),x&&(0,l.jsx)(CardBoxComponentFooter,{children:x})]}))}},64780:function(e,t,a){"use strict";var l=a(85893);a(67294);var n=a(21023),s=a(93619);t.Z=e=>{let{currentPage:t,totalItems:a,pageSize:i,onPageChange:o,maxVisiblePages:c=5}=e,r=Math.ceil(a/i),d=(()=>{let e=[],a=Math.max(0,t-Math.floor(c/2)),l=Math.min(r-1,a+c-1);l-a+1<c&&(a=Math.max(0,l-c+1));for(let t=a;t<=l;t++)e.push(t);return e})(),u=d[0]>0,m=d[d.length-1]<r-1,x=d[0]>1,h=d[d.length-1]<r-2,handlePageClick=e=>{o(e)};return r<=1?null:(0,l.jsxs)("div",{className:"flex shrink-0 items-center justify-end space-x-1 py-4",children:[(0,l.jsx)("button",{onClick:()=>{t>0&&o(t-1)},disabled:0===t,className:"flex items-center justify-center w-8 h-8 transition-colors ".concat(0===t?"text-text1 opacity-40 cursor-not-allowed":"text-labelText hover:opacity-70"),children:(0,l.jsx)(n.Z,{fontSize:"medium"})}),u&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("button",{onClick:()=>handlePageClick(0),className:"flex items-center justify-center w-8 h-8 text-[14px] font-medium transition-colors ".concat(0===t?"rounded-full bg-white text-labelText":"text-labelText hover:text-labelText hover:bg-white/50 rounded-full"),children:"1"}),x&&(0,l.jsx)("span",{className:"flex items-center justify-center w-8 h-8 text-text1",children:"..."})]}),d.map(e=>(0,l.jsx)("button",{onClick:()=>handlePageClick(e),className:"flex items-center justify-center w-8 h-8 text-[16px] font-semibold transition-colors rounded-full leading-none ".concat(t===e?"bg-globalBg2 text-labelText":"text-text1 hover:text-labelText hover:bg-white/50 hover:opacity-70"),children:e+1},e)),m&&(0,l.jsxs)(l.Fragment,{children:[h&&(0,l.jsx)("span",{className:"flex items-center justify-center w-8 h-8 text-text1",children:"..."}),(0,l.jsx)("button",{onClick:()=>handlePageClick(r-1),className:"flex items-center justify-center w-8 h-8 text-[14px] font-medium transition-colors rounded-full ".concat(t===r-1?"bg-white text-labelText":"text-text1 hover:text-labelText hover:bg-white/50 hover:opacity-70"),children:r})]}),(0,l.jsx)("button",{onClick:()=>{t<r-1&&o(t+1)},disabled:t>=r-1,className:"flex items-center justify-center w-8 h-8 transition-colors ".concat(t>=r-1?"text-text1 cursor-not-allowed opacity-40":"text-labelText hover:text-labelText hover:bg-white/50 rounded-full"),children:(0,l.jsx)(s.Z,{fontSize:"medium"})})]})}},14612:function(e,t,a){"use strict";a.r(t),a.d(t,{default:function(){return T}});var l=a(85893),n=a(9008),s=a.n(n),i=a(67294),o=a(13106),c=a(62260),r=a(90228),d=a(28552),u=a(17931),m=a(91444);a(51431);var x=a(12232),h=a(74154),f=a(11163),b=a(22840),v=a(64780),p=a(93973),C=a(96633),j=a(55317),w=a(3208),y=a(3398),N=a(53345),g=a(54250),k=a(36815);let Z=u.sk,formatTableValue=e=>
1null==e||""===e?"-":"object"==typeof e?e.label||e.name||e.id||"-":e;var TableCompanies=()=>{let e=(0,h.T)(),t=(0,f.useRouter)(),notify=(e,t)=>(0,m.Am)(t,{type:e,position:"bottom-center"}),[a,n]=(0,i.useState)(null),[s,o]=(0,i.useState)(0),[c,r]=(0,i.useState)(""),{companies:d,loading:u,count:T,notify:M,refetch:z}=(0,h.C)(e=>e.companies),{currentUser:E}=(0,h.C)(e=>e.auth),loadData=async function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:s;t!==s&&o(t);let a="?page=".concat(t,"&limit=").concat(Z,"&search=").concat(encodeURIComponent(c),"&sort=desc&field=");e((0,x.he)({limit:Z,page:t,query:a}))};(0,i.useEffect)(()=>{M.showNotification&&notify(M.typeNotification,M.textNotification)},[M.showNotification]),(0,i.useEffect)(()=>{loadData(0)},[e,c]),(0,i.useEffect)(()=>{z&&(loadData(0),e((0,x.xo)(!1)))},[z,e]);let[A,P]=(0,i.useState)(!1),handleModalAction=()=>{P(!1)},_=(0,i.useCallback)(e=>{t.push("/companies/".concat(e))},[t]),S=(0,i.useCallback)(e=>{n(e),P(!0)},[]),handleDeleteAction=async()=>{a&&(await e((0,x.wz)(a)),await loadData(0),P(!1))},L=(0,i.useMemo)(()=>!!E&&(0,y.F)(E,"CREATE_COMPANIES"),[E]),B=(0,i.useMemo)(()=>!!E&&(0,y.F)(E,["ADMIN_COMPANIES","DELETE_COMPANIES"]),[E]),D=(0,i.useMemo)(()=>[{key:"name",label:"Name",flex:1,className:"min-w-0 truncate",render:formatTableValue},{key:"email",label:"Email",flex:1,className:"min-w-0 truncate",render:formatTableValue},{key:"address",label:"Address",flex:1,className:"min-w-0 truncate",render:formatTableValue},{key:"locations",label:"Locations",flex:1,className:"min-w-0 truncate",render:e=>w.Z.locationsManyListFormatter(e||[]).join(", ")||"-"},{key:"external_client_id",label:"External Client Id",flex:1,className:"min-w-0 truncate",render:formatTableValue},{key:"status",label:"Status",flex:1,className:"min-w-0 truncate",render:e=>"1"===e?"Active":"2"===e?"Inactive":formatTableValue(e)},{key:"country",label:"Currency",flex:1,className:"min-w-0 truncate",render:e=>{var t;return(null==e?void 0:null===(t=e.currencyName)||void 0===t?void 0:t.toLowerCase())||"-"}},{key:"actions",label:"",flex:1,align:"right",render:(e,t)=>(0,l.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[(0,l.jsx)("button",{type:"button",className:"text-labelText hover:opacity-70","aria-label":"Edit",onClick:()=>_(t.id),children:(0,l.jsx)(C.Z,{path:j.I$6,size:24})}),B&&(0,l.jsx)("button",{type:"button",className:"text-labelText hover:opacity-70","aria-label":"Delete",onClick:()=>S(t.id),children:(0,l.jsx)(C.Z,{path:j.QGK,size:24})})]})}],[S,_,B]);return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(N.Z,{open:A,onClose:handleModalAction,title:"Please confirm",containerClassName:"pt-0",titleAlign:"left",className:"!w-[380px] !max-w-[calc(100vw-32px)]",actions:[{children:"Cancel",variant:"secondary",onClick:handleModalAction},{children:u?"Deleting...":"Confirm",variant:"solid",onClick:handleDeleteAction}],children:(0,l.jsx)("p",{className:"text-labelText",children:"Are you sure you want to delete this item?"})}),(0,l.jsxs)("div",{className:"flex h-full min-h-0 w-full flex-col overflow-hidden",children:[(0,l.jsxs)("div",{className:"mb-4 flex w-full shrink-0 items-center justify-between gap-4",children:[(0,l.jsx)("div",{className:"max-w-lg min-w-0 flex-1",children:(0,l.jsx)(g.Z,{searchValue:c,setSearch:r})}),L&&(0,l.jsx)(k.Z,{className:"shrink-0",label:"New Item",onClick:()=>t.push("/companies/companies-new")})]}),(0,l.jsx)(b.Z,{columns:D,data:Array.isArray(d)?d:[],className:"flex-1 min-h-0 w-full",elementClassName:"bg-globalBg2",bodyClassName:"flex-1 min-h-0",fitContent:!0}),(0,l.jsx)(v.Z,{currentPage:s,totalItems:T,pageSize:Z,onPageChange:e=>{loadData(e),o(e)},maxVisiblePages:5})]}),(0,l.jsx)(p.Z,{})]})};let CompaniesTablesPage=()=>(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(s(),{children:(0,l.jsx)("title",{children:(0,u.pz)("Companies")})}),(0,l.jsxs)(r.Z,{children:[(0,l.jsx)(d.Z,{title:"Companies Table",main:!0}),(0,l.jsx)(o.Z,{className:"mb-6 flex-1 min-h-0 overflow-hidden",bodyClassName:"min-h-0 overflow-hidden",hasTable:!0,bgcolor:"transparent",children:(0,l.jsx)(TableCompanies,{})})]})]});CompaniesTablesPage.getLayout=function(e){return(0,l.jsx)(c.Z,{permission:"READ_COMPANIES",children:e})};var T=CompaniesTablesPage}},function(e){e.O(0,[7702,518,8792,1664,7724,5892,4844,5708,6865,2260,545,5251,2840,9774,2888,179],function(){return e(e.s=14
1680)}),_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.