MCPcopy Create free account
hub / github.com/Nutlope/llamacoder / LoadingButton

Function LoadingButton

components/loading-button.tsx:5–16  ·  view source on GitHub ↗
({
  children,
  ...rest
}: ComponentProps<"button">)

Source from the content-addressed store, hash-verified

3import { useFormStatus } from "react-dom";
4
5export default function LoadingButton({
6 children,
7 ...rest
8}: ComponentProps<"button">) {
9 const { pending } = useFormStatus();
10
11 return (
12 <button {...rest} disabled={pending || rest.disabled}>
13 <Spinner loading={pending}>{children}</Spinner>
14 </button>
15 );
16}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected