import{n as e}from"./useStore-CusP06SD.js";import{a as t}from"./dist-DhH_lYkz.js";import{t as n}from"./button-1cIaa9Lf.js";import{t as r}from"./loader-circle-BQbzoYGJ.js";import{i}from"./form-context-B-ekdUc0.js";var a=e();function o({label:e,actionLabel:o,size:s=`md`}){return(0,a.jsx)(a.Fragment,{children:(0,a.jsx)(i().Subscribe,{selector:e=>[e.canSubmit,e.isSubmitting],children:([i,c])=>(0,a.jsx)(`div`,{className:`form__submit bg-background sticky right-0 bottom-0 left-0 w-full pt-4`,children:(0,a.jsx)(n,{type:`submit`,className:t(`w-full rounded-md transition-colors duration-150`,{"opacity-70":c,"px-4 py-6":s===`lg`,"px-4 py-2":s===`md`,"px-2 py-1":s===`sm`}),disabled:!i||c,children:c?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(r,{className:`size-4 animate-spin`}),` `,o??`Saving...`]}):(0,a.jsx)(a.Fragment,{children:e??`Save`})})})})})}export{o as default};