import{r as l,j as t}from"./vendor-react-wBh_31cN.js";import{a as p,b as d}from"./index.esm-CAGtek53.js";import{d as x}from"./dumbPluralize-CcxDsNiu.js";import{B as b}from"./ButtonWithRole-ruQLmPtQ.js";import{G as f}from"./index-dNe6i2rS.js";import{F as h}from"./form-footer-Drg8-unW.js";import{u as j}from"./vendor-router-D1GqFWiT.js";const C=({onSubmit:a,disabled:m,canSave:n,isLoading:e,withoutBackButton:i,saveButtonText:c="Save"})=>{const u=j(),{formState:{errors:o}}=p(),[k]=d({name:["appName"]}),s=l.useMemo(()=>{const r=Object.keys(o).length;return r?`${r} ${x("error",r)}`:""},[o]);return t.jsxs(h,{children:[!i&&t.jsx(f,{type:"button",variant:"outline",disabled:e,onClick:()=>u(-1),children:"Back"}),t.jsx(b,{disabled:m||!n,type:"submit",loading:e,onClick:a,children:c}),s&&t.jsx("span",{className:"ml-2 text-sm text-destructive",children:s})]})};export{C as J};
