import type { Book, ReadingStatus } from "../api"; const STATUS: Record = { not_started: { label: "Not started", style: "bg-slate-100 text-slate-700" }, reading: { label: "Reading", style: "bg-amber-100 text-amber-800" }, finished: { label: "Finished", style: "bg-emerald-100 text-emerald-800" }, }; export function StatusBadge({ status }: { status: ReadingStatus }) { return ( {STATUS[status].label} ); } export function ProgressBar({ book }: { book: Book }) { const percent = Math.round((book.current_page / book.total_pages) * 100); return (

{`${book.current_page} / ${book.total_pages} (${percent}%)`}

); }