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 { data: deck } = useAtomValue(deckByIdAtomFamily(deckId)); return (

{deck.name}

{deck.description &&

{deck.description}

}
); } function DeckStats({ deckId }: { deckId: string }) { const { data: deck } = useAtomValue(deckByIdAtomFamily(deckId)); const { data: cards } = useAtomValue(cardsByDeckAtomFamily(deckId)); return (

Total

{cards.length}

Due

{deck.dueCardCount}

); } 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 */}
}>
); }