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

Function SubmitButton

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

Source from the content-addressed store, hash-verified

285type ButtonProps = React.ComponentProps<"button"> & VariantProps<typeof buttonVariants>;
286
287function SubmitButton(props: ButtonProps & { children?: ReactNode }) {
288 const { state, meta, actions } = useSecretForm();
289 const { children, disabled, onClick, ...rest } = props;
290 const submitting = state.status.kind === "submitting";
291 return (
292 <Button
293 {...rest}
294 onClick={(e) => {
295 onClick?.(e);
296 if (!e.defaultPrevented) void actions.submit();
297 }}
298 disabled={disabled || !meta.canSubmit}
299 >
300 {submitting ? "Saving…" : children}
301 </Button>
302 );
303}
304
305// ---------------------------------------------------------------------------
306// Reveal-eye icon (used by ValueField when `revealable`)

Callers

nothing calls this directly

Calls 1

useSecretFormFunction · 0.85

Tested by

no test coverage detected