@@ -26,9 +26,11 @@ export default async function ReviewsPage({
2626 limit ?: number
2727 rating ?: number
2828 comment ?: string
29+ book_id ?: string
30+ user_id ?: string
2931 } >
3032} ) {
31- const { rating, comment, ...sp } = await searchParams
33+ const { rating, comment, book_id , user_id , ...sp } = await searchParams
3234 const skip = Number ( sp ?. skip ?? 0 )
3335 const limit = Number ( sp ?. limit ?? 20 )
3436
@@ -43,6 +45,8 @@ export default async function ReviewsPage({
4345 const res = await getListReviews (
4446 {
4547 library_id : activeLibraryID ,
48+ book_id,
49+ user_id,
4650 skip,
4751 rating,
4852 comment,
@@ -65,27 +69,31 @@ export default async function ReviewsPage({
6569 { res . data . map ( ( review ) => (
6670 < Card key = { review . id } className = "hover:shadow-md transition-shadow" >
6771 < CardContent >
68- < Link href = { `/admin/books/${ review . book . id } ` } className = "shrink-0" >
69- < div className = "flex gap-4" >
70- { /* 3D Book Effect */ }
71- < div className = "shrink-0" >
72- < div className = "flex" >
73- < div className = "bg-accent transform-[perspective(400px)_rotateY(314deg)] -mr-1 w-4" >
74- < span className = "inline-block text-nowrap text-[0.5rem] font-bold text-accent-foreground/50 transform-[rotate(90deg)_translateY(-16px)] origin-top-left" > </ span >
75- </ div >
76- < Image
77- src = { review . book . cover ?? '/book-placeholder.svg' }
78- alt = { review . book . title + "'s cover" }
79- width = { 96 }
80- height = { 144 }
81- className = { clsx (
82- 'shadow-xl rounded-r-md md:w-24 md:h-36 object-cover' ,
83- 'transform-[perspective(800px)_rotateY(14deg)]'
84- ) }
85- priority
86- />
72+ < div className = "flex gap-4" >
73+ { /* 3D Book Effect */ }
74+
75+ < Link
76+ href = { `/admin/books/${ review . book . id } ` }
77+ className = "shrink-0"
78+ >
79+ < div className = "flex" >
80+ < div className = "bg-accent transform-[perspective(400px)_rotateY(314deg)] -mr-1 w-4" >
81+ < span className = "inline-block text-nowrap text-[0.5rem] font-bold text-accent-foreground/50 transform-[rotate(90deg)_translateY(-16px)] origin-top-left" > </ span >
8782 </ div >
83+ < Image
84+ src = { review . book . cover ?? '/book-placeholder.svg' }
85+ alt = { review . book . title + "'s cover" }
86+ width = { 96 }
87+ height = { 144 }
88+ className = { clsx (
89+ 'shadow-xl rounded-r-md md:w-24 md:h-36 object-cover' ,
90+ 'transform-[perspective(800px)_rotateY(14deg)]'
91+ ) }
92+ priority
93+ />
8894 </ div >
95+ </ Link >
96+ < Link href = { `/admin/borrows/${ review . borrowing_id } ` } >
8997 < div className = "space-y-4" >
9098 < div className = "flex flex-col md:flex-row md:justify-between" >
9199 < div >
@@ -109,7 +117,7 @@ export default async function ReviewsPage({
109117
110118 { /* Review text */ }
111119 < div >
112- < p className = "text-sm leading-relaxed mb-4 text-foreground" >
120+ < p className = "text-sm leading-relaxed mb-4 text-foreground line-clamp-4 " >
113121 { review . comment }
114122 </ p >
115123
@@ -132,8 +140,8 @@ export default async function ReviewsPage({
132140 </ div >
133141 </ div >
134142 </ div >
135- </ div >
136- </ Link >
143+ </ Link >
144+ </ div >
137145 </ CardContent >
138146 </ Card >
139147 ) ) }
0 commit comments