'use client' import { Suspense } from 'react' import { useSearchParams } from 'next/navigation' import Link from 'next/link' import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card' import { Button } from '@/components/ui/button' import { Alert, AlertDescription } from '@/components/ui/alert' import { AlertTriangle, ArrowLeft } from 'lucide-react' function AuthErrorContent() { const searchParams = useSearchParams() const error = searchParams.get('error') const getErrorMessage = (error: string | null) => { switch (error) { case 'OAuthAccountNotLinked': return { title: 'Account Already Exists', message: 'An account with this email address already exists. Please sign in with your email and password, then you can link your Google account from your profile settings.', suggestion: 'Try signing in with your email and password instead.' } case 'OAuthCallback': return { title: 'Authentication Failed', message: 'There was an error during the Google authentication process.', suggestion: 'Please try signing in again.' } case 'AccessDenied': return { title: 'Access Denied', message: 'You denied access to your Google account.', suggestion: 'Please try again and allow access to continue.' } case 'Configuration': return { title: 'Configuration Error', message: 'There is a problem with the server configuration.', suggestion: 'Please contact support if this problem persists.' } default: return { title: 'Authentication Error', message: 'An unexpected error occurred during authentication.', suggestion: 'Please try again or contact support if the problem persists.' } } } const errorInfo = getErrorMessage(error) return (
Need help linking accounts?{' '} Contact Support