import React from "react"; import { View, Text, Image, TouchableOpacity, StyleSheet } from "react-native"; import { globalStyles } from "../../styles/global"; import { windowWidth } from "../../utils/Dimensions"; const ListItem = ({ photo, title, onPress, publishedAt }) => { const formatDate = (date) => { const tempDate = new Date(date); const fDate = tempDate.getDate() + "/" + (tempDate.getMonth() + 1) + "/" + tempDate.getFullYear(); return fDate; }; return ( {title} Published At {formatDate(publishedAt)} Read More ); }; const styles = StyleSheet.create({ cardContainer: { flexDirection: "row", justifyContent: "space-between", alignItems: "center", marginBottom: 20, }, imageContainer: { flexDirection: "row", alignItems: "center", flex: 1, }, image: { width: 55, height: 55, borderRadius: 10, marginRight: 8, }, buttonText: { color: "#fff", textAlign: "center", fontFamily: "poppins-regular", fontSize: 14, }, }); export default ListItem;