66 Book ,
77 ChevronRight ,
88 Clock ,
9- MessageSquare ,
10- Star ,
119 Calendar ,
1210 CalendarCheck ,
1311} from 'lucide-react'
@@ -20,6 +18,7 @@ import { Avatar, AvatarFallback } from '../ui/avatar'
2018import { formatDate , getBorrowStatus } from '@/lib/utils'
2119import { Badge } from '../ui/badge'
2220import { Button } from '../ui/button'
21+ import clsx from 'clsx'
2322
2423export const DataRecentBorrows : React . FC <
2524 React . ComponentProps < typeof RecentBorrows >
@@ -57,7 +56,7 @@ const RecentBorrows: React.FC<{
5756 sort_by : 'created_at' ,
5857 limit : 5 ,
5958 user_id,
60- include_review : 'true' ,
59+ // include_review: 'true',
6160 } ,
6261 {
6362 headers,
@@ -97,7 +96,11 @@ const RecentBorrows: React.FC<{
9796 < Link
9897 href = { ( ( isAdmin ? '/admin' : '' ) + `/borrows/${ borrow . id } ` ) as Route }
9998 key = { borrow . id }
100- className = "flex items-center justify-between p-4 rounded-lg border bg-muted/30 hover:bg-muted/50 transition-colors"
99+ className = { clsx (
100+ 'flex flex-row justify-between items-center p-4 rounded-lg border bg-muted/30 hover:bg-muted/50 transition-colors' ,
101+ getBorrowStatus ( borrow ) === 'active' &&
102+ 'border-(--color-vibrant,var(--color-primary))'
103+ ) }
101104 >
102105 < div className = "flex items-center gap-4" >
103106 { isAdmin && (
@@ -123,25 +126,26 @@ const RecentBorrows: React.FC<{
123126 </ div >
124127 </ div >
125128 </ div >
126- < div className = "flex items-center gap-3" >
127- { borrow . review ? (
128- < div className = "flex items-center gap-1 text-sm" >
129- < Star className = "h-4 w-4 fill-(--color-vibrant,var(--color-yellow-400)) text-(--color-vibrant,var(--color-yellow-400))" />
130- < span > { borrow . review . rating } </ span >
131- </ div >
132- ) : borrow . returning ? (
133- < Badge variant = "outline" className = "text-xs" >
134- < MessageSquare className = "h-3 w-3 mr-1" />
135- No review
136- </ Badge >
137- ) : null }
138- { getBorrowStatus ( borrow ) }
129+ < div className = "flex justify-between md: items-center gap-3" >
130+ < Badge
131+ variant = {
132+ getBorrowStatus ( borrow ) === 'overdue'
133+ ? 'destructive'
134+ : getBorrowStatus ( borrow ) === 'active'
135+ ? 'default'
136+ : 'secondary'
137+ }
138+ className = "capitalize hidden md:block"
139+ >
140+ { getBorrowStatus ( borrow ) }
141+ </ Badge >
139142 < Button variant = "ghost" size = "icon" className = "h-8 w-8" >
140143 < ChevronRight className = "h-4 w-4" />
141144 </ Button >
142145 </ div >
143146 </ Link >
144147 ) ) }
148+
145149 < div className = "" >
146150 < Link
147151 href = {
0 commit comments