import { router } from 'expo-router' import React from 'react' import { StyleSheet, Text, TouchableOpacity, View } from 'react-native' import { Post, StatusEnum } from '../models/postModel' export const CompactPostComponent: React.FC = (post) => { return ( { router.push({ pathname: '/posts/details', params: { id: post._id } }) }} > {post.notes} {post.status === StatusEnum.Created && Open} {post.status === StatusEnum.Pending && ( Pending )} {post.status === StatusEnum.Denied && Denied} {post.status === StatusEnum.Approved && ( Approved )} {post.address} {new Date(post.date).toLocaleDateString()} ) } const styles = StyleSheet.create({ text: { color: '#fff', justifyContent: 'center' }, subtext: { color: '#b9b9b9ff', justifyContent: 'center' }, posts: { marginTop: 10, backgroundColor: '#373d44ff', borderColor: '#626e7aff', borderStyle: 'solid', borderWidth: 1, borderRadius: 12, padding: 10, width: '100%' }, header: { flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between', marginBottom: 16 }, footer: { flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between' }, title: { paddingVertical: 3, borderRadius: 6, color: '#ffffff', fontSize: 16, paddingRight: 10 }, address: { paddingRight: 15 }, statusTag: { paddingVertical: 3, paddingHorizontal: 10, borderRadius: 6, fontSize: 16 }, open: { backgroundColor: '#0d6efd', color: '#ffffff' }, pending: { backgroundColor: '#ffc107', color: '#000000' }, denied: { backgroundColor: '#dc3545', color: '#ffffff' }, approved: { backgroundColor: '#198754', color: '#ffffff' } })