import { View, Text, Pressable } from "react-native";
import { Link } from "expo-router";
import { useTheme } from "./theme";
import { Badge } from "./ui/badge";
import { getCategoryName, CATEGORY_EMOJI } from "../lib/constants";
interface PostCardProps {
post: {
_id: string;
title: string;
description: string;
category?: string;
location?: string;
budget?: string;
status: string;
createdAt: number;
};
}
export function PostCard({ post }: PostCardProps) {
const theme = useTheme();
const categoryName = post.category ? getCategoryName(post.category) : null;
const emoji = post.category ? (CATEGORY_EMOJI[post.category] ?? "📋") : "📋";
const isOpen = post.status === "open";
return (
{emoji}
{post.title}
{post.description}
{categoryName && }
{post.location && (
📍 {post.location}
)}
{post.budget && (
💰 {post.budget}
)}
);
}