"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[20166],{220166(e,s,i){i.r(s),i.d(s,{default:()=>u});var t=i(274934),a=i(602086),n=i(977872),d=i(938984),l=i(159469),o=i(700444),E=i(869332),T=i(470070),_=i(561500),c=i(897166),r=i(384783);const u=()=>{const e=(0,n.wA)(),[s,i]=(0,a.useState)(!1),{_id:u,name:N,desc:C}=(0,n.d4)(c.Gd),I=(0,n.d4)(c.VO),O=(0,a.useCallback)(()=>{e((0,E.AS)())},[e]),S=(0,a.useCallback)(()=>{i(!0),e((0,_.x_)(u)).then(()=>{O(),window.location.href=`${window.location.href.substring(0,window.location.href.indexOf(N))}${I.name}/dashboard`}).catch(()=>{e((0,o.ox)({type:l.C.danger,message:"SETTINGS_SITE_CONFIGURATION_DELETE_SITE_ERROR",values:{siteName:C}}))})},[u,C,O,e,N,I.name]),A=(0,a.useMemo)(()=>[{type:"button",text:(0,t.jsx)(T.sA,{id:"COMMON_ACTION_CANCEL"}),onClick:O,disabled:s},{type:"button",text:(0,t.jsx)(T.sA,{id:"COMMON_ACTION_CONFIRM"}),onClick:S,disabled:s,variant:"primary"}],[O,s,S]);return(0,t.jsx)(r.A,{title:(0,t.jsx)(T.sA,{id:"SETTINGS_SITE_CONFIGURATION_DELETE_SITE"}),onRequestClose:O,size:"small",actions:A,children:(0,t.jsx)(d.A,{size:"medium",children:(0,t.jsx)(T.sA,{id:"SETTINGS_SITE_CONFIGURATION_DELETE_SITE_MESSAGE",values:{siteName:(0,t.jsx)("b",{children:C})}})})})}}}]);