import { faChevronLeft, faCirclePlay, faLayerGroup, } from "@fortawesome/free-solid-svg-icons"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { useAtomValue } from "jotai"; import { Suspense } from "react"; import { Link, useParams } from "wouter"; import { cardsByDeckAtomFamily, deckByIdAtomFamily } from "../atoms"; import { ErrorBoundary } from "../components/ErrorBoundary"; import { LoadingSpinner } from "../components/LoadingSpinner"; function DeckHeader({ deckId }: { deckId: string }) { const deck = useAtomValue(deckByIdAtomFamily(deckId)); return (

{deck.name}

{deck.description &&

{deck.description}

}
); } function DeckStats({ deckId }: { deckId: string }) { const cards = useAtomValue(cardsByDeckAtomFamily(deckId)); // Count cards due today const now = new Date(); const dueCards = cards.filter((card) => new Date(card.due) <= now); return (

Total Cards

{cards.length}

Due Today

{dueCards.length}

); } function DeckContent({ deckId }: { deckId: string }) { return (
{/* Deck Header */} }> {/* Deck Stats */} }> {/* Action Buttons */}
{/* Study Button */}
); } export function DeckDetailPage() { const { deckId } = useParams<{ deckId: string }>(); if (!deckId) { return (

Invalid deck ID

Back to decks
); } return (
{/* Header */}
{/* Main Content */}
}>
); }