diff --git a/frontend/app/dashboard/page.tsx b/frontend/app/dashboard/page.tsx index 695e5e4..157444d 100644 --- a/frontend/app/dashboard/page.tsx +++ b/frontend/app/dashboard/page.tsx @@ -5,33 +5,20 @@ import DailyQuestCard from "@/components/dashboard/DailyQuestCard"; import CategoryCard from "@/components/dashboard/CategoryCard"; import Image from "next/image"; import { Flame, Gem, User } from "lucide-react"; +import { useDashboard } from "@/features/dashboard"; const Dashboard = () => { const router = useRouter(); + const { data, isLoading, error } = useDashboard(); - const categories = [ - { - icon: "🧩", - name: "Puzzles", - description: "Pattern Recognition", - userLevel: "Level 5", - slug: "puzzles", - }, - { - icon: "💻", - name: "Coding", - description: "Algorithm and Data Structures", - userLevel: "Level 2", - slug: "coding", - }, - { - icon: "⛓️", - name: "Blockchain", - description: "Crypto & Defi Concepts", - userLevel: "Level 2", - slug: "blockchain", - }, - ]; + // Get stats from context or use defaults + const stats = data?.stats; + const streak = stats?.streak ?? 0; + const points = stats?.points ?? 0; + const dailyQuestProgress = stats?.dailyQuestProgress ?? { completed: 0, total: 5 }; + + // Get categories from context or use empty array + const categories = data?.categories ?? []; return (