import{aA as l,o as u,p as c,k as d,l as h,j as e,E as x,G as j,az as S,ax as R,a9 as s}from"./app-BgLa5dit.js";const y=l.object().shape({name:l.string().required(()=>"Name is required")});function b(a){var r,n;const t=u(c.getReportTemplate(a.id)),p=d(),o=h();async function m({name:i}){try{await p(c.updateReportTemplate({...t.data,name:i})),o.success(`Successfully renamed report template: ${i}`)}catch{o.error("Failed to update report template. Please try again.")}a.closePopup()}return e.jsx(x,{title:"Edit Report Template",closePopup:a.closePopup,showLoadingSpinner:!((r=t.data)!=null&&r.name),children:e.jsx(j,{initialValues:{name:(n=t.data)==null?void 0:n.name},validationSchema:y,onSubmit:m,children:e.jsxs(S,{children:[e.jsx(R,{name:"name",id:"name",placeholder:"e.g. Steven's Fave Report",label:"Name",showRequiredStar:!0}),e.jsxs(s,{children:[e.jsx(s.Cancel,{onClick:a.closePopup}),e.jsx(s.Submit,{variant:"dark",text:"Save changes"})]})]})})})}export{b as AssemblyLineEditReportTemplateView};
//# sourceMappingURL=CcwgaGu7.chunk.js.map
