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