@@ -47,63 +47,65 @@ export const ListCardBorrow: React.FC<
4747 ) . toString ( ) ) as Route < string >
4848
4949 return (
50- < Card
51- key = { borrow . id }
52- className = { cn ( 'relative' , status === 'lost' && 'bg-destructive/5' ) }
53- >
54- < CardHeader >
55- < Link href = { href } className = "flex justify-between items-start min-h-20" >
56- < div >
57- < CardTitle className = "text-lg line-clamp-2" >
58- < abbr title = { borrow . book . title } className = "no-underline" >
59- { borrow . book . title }
60- </ abbr >
61- </ CardTitle >
62- < CardDescription >
63- < span className = "text-muted-foreground/80 font-bold tracking-wider" >
64- # { idx . toString ( ) . padStart ( 4 , '0' ) }
65- </ span >
66- </ CardDescription >
67- </ div >
68- < Badge
69- variant = {
70- getBorrowStatus ( borrow ) === 'overdue'
71- ? 'destructive'
72- : getBorrowStatus ( borrow ) === 'active'
73- ? 'default'
74- : 'secondary'
75- }
76- className = "capitalize"
50+ < ViewTransition name = { borrow . id } key = { borrow . id } >
51+ < Card className = { cn ( 'relative' , status === 'lost' && 'bg-destructive/5' ) } >
52+ < CardHeader >
53+ < Link
54+ href = { href }
55+ className = "flex justify-between items-start min-h-20"
7756 >
78- { getBorrowStatus ( borrow ) }
79- </ Badge >
80- </ Link >
81- </ CardHeader >
82- < CardContent className = "space-y-3" >
83- < div className = "flex items-center gap-2 text-sm" >
84- < User className = "size-4 text-muted-foreground" />
85- < span > { borrow . subscription . user . name } </ span >
86- </ div >
87- < div className = "flex items-center gap-2 text-sm" >
88- < LibraryIcon className = "size-4 text-muted-foreground" />
89- < span > { borrow . subscription . membership . library . name } </ span >
90- </ div >
91- < div className = "flex items-center gap-2 text-sm" >
92- < Calendar className = "size-4 text-muted-foreground" />
93- < span > Borrowed: { formatDate ( borrow . borrowed_at ) } </ span >
94- </ div >
95- < div className = "flex items-center gap-2 text-sm" >
96- { isDue ? (
97- < CalendarX className = "size-4 text-destructive" />
98- ) : (
99- < CalendarClock className = "size-4 text-muted-foreground" />
100- ) }
101- < span className = { cn ( isDue && 'text-destructive' ) } >
102- Due: { formatDate ( borrow . due_at ) }
103- </ span >
104- </ div >
105- </ CardContent >
106- < CardFooter > { children } </ CardFooter >
107- </ Card >
57+ < div >
58+ < CardTitle className = "text-lg line-clamp-2" >
59+ < abbr title = { borrow . book . title } className = "no-underline" >
60+ { borrow . book . title }
61+ </ abbr >
62+ </ CardTitle >
63+ < CardDescription >
64+ < span className = "text-muted-foreground/80 font-bold tracking-wider" >
65+ # { idx . toString ( ) . padStart ( 4 , '0' ) }
66+ </ span >
67+ </ CardDescription >
68+ </ div >
69+ < Badge
70+ variant = {
71+ getBorrowStatus ( borrow ) === 'overdue'
72+ ? 'destructive'
73+ : getBorrowStatus ( borrow ) === 'active'
74+ ? 'default'
75+ : 'secondary'
76+ }
77+ className = "capitalize"
78+ >
79+ { getBorrowStatus ( borrow ) }
80+ </ Badge >
81+ </ Link >
82+ </ CardHeader >
83+ < CardContent className = "space-y-3" >
84+ < div className = "flex items-center gap-2 text-sm" >
85+ < User className = "size-4 text-muted-foreground" />
86+ < span > { borrow . subscription . user . name } </ span >
87+ </ div >
88+ < div className = "flex items-center gap-2 text-sm" >
89+ < LibraryIcon className = "size-4 text-muted-foreground" />
90+ < span > { borrow . subscription . membership . library . name } </ span >
91+ </ div >
92+ < div className = "flex items-center gap-2 text-sm" >
93+ < Calendar className = "size-4 text-muted-foreground" />
94+ < span > Borrowed: { formatDate ( borrow . borrowed_at ) } </ span >
95+ </ div >
96+ < div className = "flex items-center gap-2 text-sm" >
97+ { isDue ? (
98+ < CalendarX className = "size-4 text-destructive" />
99+ ) : (
100+ < CalendarClock className = "size-4 text-muted-foreground" />
101+ ) }
102+ < span className = { cn ( isDue && 'text-destructive' ) } >
103+ Due: { formatDate ( borrow . due_at ) }
104+ </ span >
105+ </ div >
106+ </ CardContent >
107+ < CardFooter > { children } </ CardFooter >
108+ </ Card >
109+ </ ViewTransition >
108110 )
109111}
0 commit comments