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 { getEndOfStudyDayBoundary } from "../../shared/date"; import { cardsByDeckAtomFamily, deckByIdAtomFamily } from "../atoms"; import { ErrorBoundary } from "../components/ErrorBoundary"; import { LoadingSpinner } from "../components/LoadingSpinner"; function DeckHeader({ deckId }: { deckId: string }) { const { data: deck } = useAtomValue(deckByIdAtomFamily(deckId)); return (

{deck.name}

{deck.description &&

{deck.description}

}
); } function DeckStats({ deckId }: { deckId: string }) { const { data: cards } = useAtomValue(cardsByDeckAtomFamily(deckId)); // Count cards due today (study day boundary is 3:00 AM) const boundary = getEndOfStudyDayBoundary(); const dueCards = cards.filter((card) => new Date(card.due) < boundary); 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 */}
}>
); }