import { Database } from '@/types_db' import Link from 'next/link' import { Book, Clock, Download } from 'lucide-react' type Deck = Database['public']['Tables']['decks']['Row'] export default function DeckList({ decks }: { decks: Deck[] }) { if (decks.length === 0) { return (

No decks found

Get started by creating a new deck.

{/* Action to create deck could go here in future */}
) } return (
{decks.map((deck) => (
{deck.cover_image_url ? ( {deck.title ) : (
)}

{deck.title || 'Untitled Deck'}

{deck.description || 'No description provided.'}

{deck.downloads || 0}
{deck.last_studied_at && (
{new Date(deck.last_studied_at).toLocaleDateString()}
)}
))}
) }