import { useTRPC } from '@/integrations/trpc/react'; import { useMutation } from '@tanstack/react-query'; import { Button } from '../ui/button'; export function SignInGithub({ type, inviteId, isLastUsed, }: { type: 'sign-in' | 'sign-up'; inviteId?: string; isLastUsed?: boolean }) { const trpc = useTRPC(); const mutation = useMutation( trpc.auth.signInOAuth.mutationOptions({ onSuccess(res) { if (res.url) { window.location.href = res.url; } }, }), ); const title = () => { if (type === 'sign-in') return 'Sign in with Github'; if (type === 'sign-up') return 'Sign up with Github'; }; return (