MCPcopy Index your code
hub / github.com/CapSoftware/Cap / SignInButton

Function SignInButton

apps/desktop/src/components/SignInButton.tsx:6–29  ·  view source on GitHub ↗
(
	props: Omit<ComponentProps<typeof Button>, "onClick">,
)

Source from the content-addressed store, hash-verified

4import { createSignInMutation } from "~/utils/auth";
5
6export function SignInButton(
7 props: Omit<ComponentProps<typeof Button>, "onClick">,
8) {
9 const signIn = createSignInMutation();
10
11 return (
12 <Button
13 size="md"
14 class="flex grow justify-center items-center"
15 {...props}
16 variant={signIn.isPending ? "gray" : "primary"}
17 onClick={() => {
18 if (signIn.isPending) {
19 signIn.variables.abort();
20 signIn.reset();
21 } else {
22 signIn.mutate(new AbortController());
23 }
24 }}
25 >
26 {signIn.isPending ? "Cancel Sign In" : (props.children ?? "Sign In")}
27 </Button>
28 );
29}

Callers

nothing calls this directly

Calls 2

createSignInMutationFunction · 0.90
abortMethod · 0.80

Tested by

no test coverage detected