import { View, Text, Pressable } from "react-native"; import { Link } from "expo-router"; import { useTheme } from "./theme"; import { Badge } from "./ui/badge"; import { Rating } from "./ui/rating"; import { getCategoryName, CATEGORY_EMOJI } from "../lib/constants"; interface AdCardProps { ad: { _id: string; title: string; category: string; location: string; priceRange?: string; ratingAvg?: number; reviewCount: number; }; } export function AdCard({ ad }: AdCardProps) { const theme = useTheme(); const categoryName = getCategoryName(ad.category); const emoji = CATEGORY_EMOJI[ad.category] ?? "🔧"; return ( {emoji} {ad.title} {ad.ratingAvg != null && ad.ratingAvg > 0 && ( )} {ad.priceRange && ( {ad.priceRange} )} 📍 {ad.location} ); }