import{b2 as h,bc as x,az as F,ao as e,aF as v,L as f,ck as j,bU as c}from"./app-k0jcl5PQ.js";import{l as m}from"./DLmnDxSd.chunk.js";import{F as C}from"./DV1GpLCe.chunk.js";import{F as L,u as b}from"./C3DvQ1wU.chunk.js";import{L as l}from"./F6ooBnzv.chunk.js";import"./CW7x8M-z.chunk.js";import"./Di9d6zcy.chunk.js";import"./CKctgafI.chunk.js";const P="settings.renameLocalCache",a=f.encloseNamespace(P),g=m.object().shape({name:m.string().required(()=>a("required")).max(255,()=>a("maxNameLength"))});function k(s){const o=b();return e.jsxs(j,{children:[e.jsx(C,{label:a("name"),type:"text",name:"name",id:"name",placeholder:a("placeholder"),autoFocus:!0,value:o.values.name,showRequiredStar:!0}),e.jsxs(c,{children:[e.jsx(c.Cancel,{onClick:s.onClickCancel}),e.jsx(c.Submit,{variant:"dark",text:a("title")})]})]})}function I(s){var r;const o=h(),n=x(),t=F(l.device(s.deviceId));function u(d){const p=l.updateDevice(s.deviceId,{...t.data,deviceName:d.name},()=>n.success(a("success")),()=>n.success(a("error")),()=>s.closePopup());o(p)}const i=!!t.data;return e.jsx(v,{title:a("title"),closePopup:s.closePopup,showLoadingSpinner:!i,children:e.jsx(L,{onSubmit:u,initialValues:{name:((r=t==null?void 0:t.data)==null?void 0:r.deviceName)||""},validationSchema:g,children:!!i&&e.jsx(k,{onClickCancel:s.closePopup})})})}export{I as RenameLocalCacheView};
//# sourceMappingURL=B6df8a8Q.chunk.js.map
