"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[49],{790049:(e,t,a)=>{a.r(t),a.d(t,{default:()=>T});var s=a(296540),n=a(469733),i=a(927099),l=a(459449),E=a(323572),c=a(675359),o=a(126457),r=a(742920),u=a(602021),d=a(705426);const T=()=>{const e=(0,n.useDispatch)(),[t,a]=(0,s.useState)(!1),{_id:T,name:_,desc:N}=(0,n.useSelector)(u.Gd),C=(0,n.useSelector)(u.VO),I=(0,s.useCallback)(()=>e((0,o.AS)()),[e]),S=(0,s.useCallback)(()=>{a(!0),e((0,E.x_)(T)).then(()=>{I(),window.location.href=`${window.location.href.substring(0,window.location.href.indexOf(_))}${C.name}/dashboard`}).catch(()=>{e((0,c.ox)({type:r.C.danger,message:"SETTINGS_SITE_CONFIGURATION_DELETE_SITE_ERROR",values:{siteName:N}}))})},[T,N,I,e,_,C.name]),m=(0,s.useMemo)(()=>[{type:"button",text:s.createElement(l.sA,{id:"COMMON_ACTION_CANCEL"}),onClick:I,disabled:t},{type:"button",text:s.createElement(l.sA,{id:"COMMON_ACTION_CONFIRM"}),onClick:S,disabled:t,variant:"primary"}],[I,t,S]);return s.createElement(d.A,{title:s.createElement(l.sA,{id:"SETTINGS_SITE_CONFIGURATION_DELETE_SITE"}),onRequestClose:I,size:"small",actions:m},s.createElement(i.A,{size:"body"},s.createElement(l.sA,{id:"SETTINGS_SITE_CONFIGURATION_DELETE_SITE_MESSAGE",values:{siteName:s.createElement("b",null,N)}})))}}}]);