MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / SubmitButton

Function SubmitButton

packages/react/src/plugins/secret-form.tsx:303–319  ·  view source on GitHub ↗
(props: ButtonProps & { children?: ReactNode })

Source from the content-addressed store, hash-verified

301type ButtonProps = React.ComponentProps<"button"> & VariantProps<typeof buttonVariants>;
302
303function SubmitButton(props: ButtonProps & { children?: ReactNode }) {
304 const { state, meta, actions } = useSecretForm();
305 const { children, disabled, onClick, ...rest } = props;
306 const submitting = state.status.kind === "submitting";
307 return (
308 <Button
309 {...rest}
310 onClick={(e) => {
311 onClick?.(e);
312 if (!e.defaultPrevented) void actions.submit();
313 }}
314 disabled={disabled || !meta.canSubmit}
315 >
316 {submitting ? "Saving…" : children}
317 </Button>
318 );
319}
320
321// ---------------------------------------------------------------------------
322// Reveal-eye icon (used by ValueField when `revealable`)

Callers

nothing calls this directly

Calls 1

useSecretFormFunction · 0.85

Tested by

no test coverage detected