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 } 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);
return (
{ad.title}
{ad.ratingAvg != null && ad.ratingAvg > 0 && (
)}
{ad.priceRange && (
{ad.priceRange}
)}
📍 {ad.location}
);
}