/* 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...

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

Deck Hearth

The ultimate hub for trading card collectors. Organize your cards into lists, discover rare cards, and connect with fellow enthusiasts in one beautiful platform.

Everything You Need to Manage Your Cards

Organize Lists

Create custom lists, track card values, and organize by sets, rarity, or any system that works for you.

Discover Cards

Search through thousands of cards across multiple TCGs. Find that missing piece for your binder.

Connect & Share

Share your lists with the community, collaborate with friends, and discover amazing lists from other collectors.

Featured Lists

Discover amazing lists from our community

{collectionsLoading ? (
{[...Array(6)].map((_, i) => (
))}
) : (
{featuredCollections.map((collection) => (
{collection.image ? ( {collection.name} ) : (

{collection.cardCount} cards

)}

{collection.name}

{collection.description || 'A carefully curated list'}

{collection.cardCount} cards by {collection.creator}
))}
)}

Ready to Start Your Journey?

Join thousands of collectors who trust Deck Hearth to manage their cards and lists.

); }