feat(backoffice): afficher le format (cbz/cbr/pdf) au lieu du kind sur les cards
- Ajoute `format: string | null` dans BookDto - BookCard et page détail utilisent `book.format ?? book.kind` avec les couleurs success=CBZ, warning=CBR, destructive=PDF Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -120,9 +120,12 @@ export default async function BookDetailPage({
|
|||||||
<div className="flex items-center justify-between py-2 border-b border-border">
|
<div className="flex items-center justify-between py-2 border-b border-border">
|
||||||
<span className="text-sm text-muted-foreground">Format:</span>
|
<span className="text-sm text-muted-foreground">Format:</span>
|
||||||
<span className={`inline-flex px-2.5 py-1 rounded-full text-xs font-semibold ${
|
<span className={`inline-flex px-2.5 py-1 rounded-full text-xs font-semibold ${
|
||||||
book.kind === 'epub' ? 'bg-primary/10 text-primary' : 'bg-muted/50 text-muted-foreground'
|
(book.format ?? book.kind) === 'cbz' ? 'bg-success/10 text-success' :
|
||||||
|
(book.format ?? book.kind) === 'cbr' ? 'bg-warning/10 text-warning' :
|
||||||
|
(book.format ?? book.kind) === 'pdf' ? 'bg-destructive/10 text-destructive' :
|
||||||
|
'bg-muted/50 text-muted-foreground'
|
||||||
}`}>
|
}`}>
|
||||||
{book.kind.toUpperCase()}
|
{(book.format ?? book.kind).toUpperCase()}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ export default async function BooksPage({
|
|||||||
volume: hit.volume,
|
volume: hit.volume,
|
||||||
language: hit.language,
|
language: hit.language,
|
||||||
page_count: null,
|
page_count: null,
|
||||||
|
format: null,
|
||||||
file_path: null,
|
file_path: null,
|
||||||
file_format: null,
|
file_format: null,
|
||||||
file_parse_status: null,
|
file_parse_status: null,
|
||||||
|
|||||||
@@ -102,14 +102,16 @@ export function BookCard({ book, readingStatus }: BookCardProps) {
|
|||||||
|
|
||||||
{/* Meta Tags */}
|
{/* Meta Tags */}
|
||||||
<div className="flex items-center gap-2 mt-2">
|
<div className="flex items-center gap-2 mt-2">
|
||||||
|
{(book.format ?? book.kind) && (
|
||||||
<span className={`
|
<span className={`
|
||||||
px-2 py-0.5 text-[10px] font-bold uppercase tracking-wider rounded-full
|
px-2 py-0.5 text-[10px] font-bold uppercase tracking-wider rounded-full
|
||||||
${book.kind === 'cbz' ? 'bg-success/10 text-success' : ''}
|
${(book.format ?? book.kind) === 'cbz' ? 'bg-success/10 text-success' : ''}
|
||||||
${book.kind === 'cbr' ? 'bg-warning/10 text-warning' : ''}
|
${(book.format ?? book.kind) === 'cbr' ? 'bg-warning/10 text-warning' : ''}
|
||||||
${book.kind === 'pdf' ? 'bg-destructive/10 text-destructive' : ''}
|
${(book.format ?? book.kind) === 'pdf' ? 'bg-destructive/10 text-destructive' : ''}
|
||||||
`}>
|
`}>
|
||||||
{book.kind}
|
{book.format ?? book.kind}
|
||||||
</span>
|
</span>
|
||||||
|
)}
|
||||||
{book.language && (
|
{book.language && (
|
||||||
<span className="px-2 py-0.5 text-[10px] font-medium uppercase tracking-wider rounded-full bg-primary/10 text-primary">
|
<span className="px-2 py-0.5 text-[10px] font-medium uppercase tracking-wider rounded-full bg-primary/10 text-primary">
|
||||||
{book.language}
|
{book.language}
|
||||||
|
|||||||
@@ -59,6 +59,7 @@ export type BookDto = {
|
|||||||
id: string;
|
id: string;
|
||||||
library_id: string;
|
library_id: string;
|
||||||
kind: string;
|
kind: string;
|
||||||
|
format: string | null;
|
||||||
title: string;
|
title: string;
|
||||||
author: string | null;
|
author: string | null;
|
||||||
series: string | null;
|
series: string | null;
|
||||||
|
|||||||
Reference in New Issue
Block a user