import { useEffect } from "react"; import { useNavigate } from "react-router-dom"; import { useDiscordActivity } from "@/contexts/DiscordActivityContext"; import LoadingScreen from "@/components/LoadingScreen"; import { useAuth } from "@/contexts/AuthContext"; import Dashboard from "./Dashboard"; export default function Activity() { const navigate = useNavigate(); const { isActivity, isLoading, user, error } = useDiscordActivity(); const { user: authUser } = useAuth(); useEffect(() => { if (!isActivity && !isLoading) { navigate("/", { replace: true }); } }, [isActivity, isLoading, navigate]); if (isLoading) { return ( ); } if (error) { return (

❌ Activity Error

{error}

Troubleshooting Steps:

  1. Clear your browser cache (Ctrl+Shift+Delete)
  2. Close Discord completely
  3. Reopen Discord
  4. Try opening the Activity again

💡 Open browser console (F12) and look for messages starting with{" "} [Discord Activity]

Still having issues? Check the{" "} troubleshooting guide

); } if (!isActivity) { return null; } if (user) { return (

Welcome to AeThex, {user.full_name || user.username}! 🎉

Discord Activity

👤 Your Profile

{user.avatar_url && ( {user.full_name )}

Name: {user.full_name || "Not set"}

Username: {user.username || "Not set"}

Type: {user.user_type || "community_member"}

{user.bio && (

"{user.bio}"

)}

⚔️ Your Realm

{user.primary_arm?.toUpperCase() || "LABS"}

Your primary realm determines your Discord role and access to realm-specific features.

🚀 Quick Actions

🎨 Browse Creators 💼 Find Opportunities ⚙️ Settings

💡 Tip: Use Discord commands like{" "} /profile,{" "} /set-realm, and{" "} /verify-role {" "} to manage your account within Discord.

); } return ( ); }