import Link from "next/link" import Image from "next/image" import { Star, Calendar, Database } from "lucide-react" import { Card, CardContent } from "@/components/ui/card" import { Badge } from "@/components/ui/badge" interface Manga { id: number title: string coverImageKey?: string status?: string publishedFrom?: string publishedTo?: string providerCount?: number authors: string[] genres: string[] score: number // chapters: number } interface MangaCardProps { manga: Manga } export function MangaCard({ manga }: MangaCardProps) { const formatter = new Intl.DateTimeFormat('en-US', { month: '2-digit', day: '2-digit', year: 'numeric' }); const publishedTo = manga.publishedTo ? formatter.format(new Date(manga.publishedTo)) : null; const publishedFrom = manga.publishedFrom ? formatter.format(new Date(manga.publishedFrom)) : null; const dateRange = publishedTo ? `${publishedFrom} - ${publishedTo}` : `${publishedFrom} - Present` const author = manga.authors.join(', '); return (
{manga.title}
{manga.status}
{/* Info */}

{manga.title}

{author}

{publishedFrom &&
{dateRange}
}
{manga.score}
{/*Ch. {manga.chapters}*/}
{manga.providerCount} {manga.providerCount === 1 ? "provider" : "providers"}
{manga.genres.map((genre) => ( {genre} ))}
) }