"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[3089],{955615:(e,t,l)=>{l.d(t,{T:()=>c,o:()=>o});var a=l(801081),n=l(25553),r=l(87485),i=l(606187);const c=e=>(0,a.Mz)((0,n.uh)((0,i.fw)(e)),r.i6),o=(0,a.Mz)((0,n.uh)((0,i.GB)()),r.kh)},545512:(e,t,l)=>{l.d(t,{A:()=>s});var a=l(296540),n=l(951106),r=l(294303),i=l(566723),c=l(703447),o=l(115829);const s=({defaultName:e="",client:t=null,width:l=25,height:s=25,alt:d})=>a.createElement(r.A,{alignItems:"center",gap:i.kc},a.createElement(c.A,{client:t,width:l,height:s,alt:d}),a.createElement(o.A,{variant:"inherit"},(0,n.tn)(t)||e))},708719:(e,t,l)=>{l.d(t,{A:()=>o});var a=l(296540),n=l(469733),r=l(602021),i=l(294303),c=l(876773);const o=({allowReadOnly:e,...t})=>{const l=(0,n.useSelector)(r.EL)&&!e;return a.createElement(i.A,{alignItems:"center"},a.createElement(c.A,{size:"medium",type:"button",...t,disabled:l||t.isDisabled}))}},783089:(e,t,l)=>{l.r(t),l.d(t,{default:()=>v});var a=l(296540),n=l(469733),r=l(42345),i=l(459449),c=l(15095),o=l(118835),s=l(708719),d=l(606187),m=l(627440),u=l(865145),E=l(963070),C=l(620637),A=l(249304),h=l(905410),p=l(845030),w=l(398300),b=l(396660),f=l(951106),g=l(545512),k=l(149133),N=l(115829),_=l(689965),I=l(955615);const O=[{id:"name",growthFactor:1,sortable:!0,label:a.createElement(i.sA,{id:"COMMON_CLIENT"}),renderCell:e=>a.createElement(g.A,{client:e}),compare:(0,b.l0)(e=>(0,f.tn)(e))},{id:"ip",growthFactor:1,sortable:!0,label:a.createElement(i.sA,{id:"COMMON_IP_ADDRESS"}),renderCell:({ip:e})=>a.createElement(N.A,null,e||a.createElement(i.sA,{id:"COMMON_FALLBACK"})),compare:(0,b.l0)(({ip:e})=>e&&(0,C.isValidIpv4)(e)?(0,k.GQ)(e):0)}],M=[{value:20,default:!0}],T=({network:e})=>{const t=(0,n.useDispatch)(),l=(0,n.useSelector)((0,I.T)(e._id)),r=(0,a.useMemo)(()=>l?.dhcp_lease_info||[],[l]),[i,c]=(0,a.useState)(0),o=(0,a.useCallback)(e=>{e!==i&&c(e)},[i]),s=(0,a.useCallback)(()=>c(0),[]),d=(0,a.useCallback)(e=>t((0,p.XP)({type:w.H.CLIENT,id:e.mac})),[t]),m=(0,a.useCallback)(({from:e,rowsPerPage:t})=>a.createElement(E.A,{items:r,onRowClick:d,disableColumnFilters:!0,idField:"mac",initialSortBy:"ip",columns:O,rowLimit:t,rowOffset:e,truncateHeaderCells:!0}),[r,d]);return r.length?a.createElement(_.A,null,a.createElement(h.A,{wrapperFlexProps:{padding:"0",overflowX:"hidden",overflowY:"scroll"},tableType:A.l.NETWORK_CLIENTS,itemCount:r.length,onRenderTable:m,onPageChanged:o,onRowsChanged:s,pageNumber:i,rowOptions:M})):null},v=({activeItem:e})=>{const t=(0,n.useDispatch)(),l=(0,c.A)(`${m.VO.CLIENTS}/${o.M.DHCP}`);return(0,a.useEffect)(()=>{t((0,d.fw)(e._id))},[t,e._id]),a.createElement(a.Fragment,null,a.createElement(T,{network:e}),a.createElement(r.A,{actions:[a.createElement(s.A,{allowReadOnly:!0,to:l,onClick:()=>t((0,u.lj)(e._id))},a.createElement(i.sA,{id:"SETTINGS_VIEW_IN_DHCP_MANAGER"}))]}))}}}]);