@@ -2,7 +2,7 @@ import Image from "next/image";
22import Link from "next/link" ;
33import { Calendar } from "lucide-react" ;
44import { Badge } from "@/components/ui/badge" ;
5- import { formatPrice , formatCondition , formatDate } from "@/lib/utils" ;
5+ import { formatPrice , formatCondition , formatDate , cn } from "@/lib/utils" ;
66import { Item , Sublet } from "@/lib/types" ;
77
88const DEFAULT_IMAGE = "/images/default-image.jpg" ;
@@ -58,7 +58,12 @@ export const ListingsCard = ({ listing, previewImageUrl, href, isMyListing = fal
5858 return (
5959 < Link
6060 href = { href }
61- className = "group flex w-full flex-col overflow-hidden rounded-xl border border-gray-200 bg-white transition-all duration-200 hover:shadow-lg"
61+ className = { cn (
62+ "group flex w-full flex-col overflow-hidden rounded-xl border bg-white transition-all duration-200 hover:shadow-lg" ,
63+ isMyListing && listing . status === "PENDING" && "border-amber-300 opacity-70" ,
64+ isMyListing && listing . status === "REJECTED" && "border-red-300 opacity-50" ,
65+ ! ( isMyListing && listing . status !== "APPROVED" ) && "border-gray-200"
66+ ) }
6267 >
6368 { /* image container */ }
6469 < div className = "relative aspect-square w-full overflow-hidden bg-gray-100" >
@@ -77,6 +82,20 @@ export const ListingsCard = ({ listing, previewImageUrl, href, isMyListing = fal
7782 </ Badge >
7883 </ div >
7984 ) }
85+ { isMyListing && listing . status === "PENDING" && (
86+ < div className = "absolute top-3 right-3" >
87+ < Badge className = "border-none bg-amber-500 text-white shadow-sm hover:bg-amber-600" >
88+ Under Review
89+ </ Badge >
90+ </ div >
91+ ) }
92+ { isMyListing && listing . status === "REJECTED" && (
93+ < div className = "absolute top-3 right-3" >
94+ < Badge className = "border-none bg-red-500 text-white shadow-sm hover:bg-red-600" >
95+ Rejected
96+ </ Badge >
97+ </ div >
98+ ) }
8099 < div className = "absolute bottom-3 left-3" >
81100 < Badge className = "border-none bg-white/90 text-gray-900 shadow-sm backdrop-blur-sm hover:bg-white" >
82101 { getBadgeContent ( listing ) }
0 commit comments