style: drop redundant comments and apply formatting
Frontend now uses double quotes and semicolons. No behaviour change.
This commit is contained in:
+11
-9
@@ -1,21 +1,23 @@
|
||||
import type { Book, ReadingStatus } from '../api'
|
||||
import type { Book, ReadingStatus } from "../api";
|
||||
|
||||
const STATUS: Record<ReadingStatus, { label: string; style: string }> = {
|
||||
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' },
|
||||
}
|
||||
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 (
|
||||
<span className={`rounded-full px-2 py-0.5 text-xs font-medium whitespace-nowrap ${STATUS[status].style}`}>
|
||||
<span
|
||||
className={`rounded-full px-2 py-0.5 text-xs font-medium whitespace-nowrap ${STATUS[status].style}`}
|
||||
>
|
||||
{STATUS[status].label}
|
||||
</span>
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
export function ProgressBar({ book }: { book: Book }) {
|
||||
const percent = Math.round((book.current_page / book.total_pages) * 100)
|
||||
const percent = Math.round((book.current_page / book.total_pages) * 100);
|
||||
return (
|
||||
<div className="mt-3">
|
||||
<progress
|
||||
@@ -26,5 +28,5 @@ export function ProgressBar({ book }: { book: Book }) {
|
||||
/>
|
||||
<p className="text-sm text-slate-600">{`${book.current_page} / ${book.total_pages} (${percent}%)`}</p>
|
||||
</div>
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user