/* eslint-disable @next/next/no-img-element -- External or generated image URLs; next/image migration is out of scope. */ import { useState, useEffect } from 'react'; import { useRouter } from 'next/router'; import Link from 'next/link'; import { useAuth } from '../lib/use-auth.js'; import AnimatedFireLogo from '../components/AnimatedFireLogo'; import { Button, GlassSurface } from '../components/ui'; export default function Home() { const { user, loading } = useAuth(); const router = useRouter(); const [featuredCollections, setFeaturedCollections] = useState([]); const [collectionsLoading, setCollectionsLoading] = useState(true); useEffect(() => { if (!loading && user) { router.push('/dashboard'); } }, [user, loading, router]); useEffect(() => { const fetchFeaturedCollections = async () => { try { const response = await fetch('/api/public/collections?limit=6'); if (response.ok) { const collections = await response.json(); setFeaturedCollections(collections); } } catch (error) { console.error('Error fetching featured collections:', error); } finally { setCollectionsLoading(false); } }; fetchFeaturedCollections(); }, []); if (loading) { return (
Loading...
The ultimate hub for trading card collectors. Organize your cards into lists, discover rare cards, and connect with fellow enthusiasts in one beautiful platform.
Create custom lists, track card values, and organize by sets, rarity, or any system that works for you.
Search through thousands of cards across multiple TCGs. Find that missing piece for your binder.
Share your lists with the community, collaborate with friends, and discover amazing lists from other collectors.
Discover amazing lists from our community
{collection.cardCount} cards
{collection.description || 'A carefully curated list'}
Join thousands of collectors who trust Deck Hearth to manage their cards and lists.