import{j as a,d as n,bx as p}from"./index-DRe7Uehz.js";const m=o=>{const{isEdit:t,formik:e,close:i,additionalFormInput:r}=o,s=l=>{l.key==="Escape"&&i()};return a.jsx(n.Modal,{className:"snapshot-creation-modal",close:i,title:`${t?"Edit":"Create"} snapshot`,buttonRow:a.jsxs(a.Fragment,{children:[a.jsx(n.Button,{appearance:"base",className:"u-no-margin--bottom",type:"button",onClick:i,children:"Cancel"}),a.jsx(n.ActionButton,{appearance:"positive",loading:e.isSubmitting,disabled:!e.isValid,onClick:()=>void e.submitForm(),children:t?"Save changes":"Create snapshot"})]}),onKeyDown:s,children:a.jsxs(n.Form,{onSubmit:e.handleSubmit,children:[a.jsx(n.Input,{id:"name",name:"name",type:"text",label:"Snapshot name",onChange:e.handleChange,onBlur:e.handleBlur,value:e.values.name,error:e.touched.name||t?e.errors.name:null,takeFocus:!0}),a.jsxs(n.Row,{className:"expiration-wrapper",children:[a.jsx(n.Col,{size:6,children:a.jsx(n.Input,{id:"expirationDate",name:"expirationDate",type:"date",label:"Expiry date",min:p(),onChange:e.handleChange,onBlur:e.handleBlur,value:e.values.expirationDate??"",error:e.touched.expirationDate?e.errors.expirationDate:null})}),a.jsx(n.Col,{size:6,children:a.jsx(n.Input,{id:"expirationTime",name:"expirationTime",type:"time",label:"Expiry time",onChange:e.handleChange,onBlur:e.handleBlur,value:e.values.expirationTime??"",error:e.touched.expirationTime?e.errors.expirationTime:null})})]}),r]})})};export{m as S};
