import { useMutation } from '@tanstack/react-query'; import { Button } from '../ui/button'; import { useTRPC } from '@/integrations/trpc/react'; export function SignInGoogle({ 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 Google'; } if (type === 'sign-up') { return 'Sign up with Google'; } }; return (