import React from "react"; import { View, Text, Image, TouchableOpacity, StyleSheet } from "react-native"; import { globalStyles } from "@styles/global"; import { windowWidth } from "@utils/Dimensions"; import { useTheme } from "@styles"; import { useTranslation } from "react-i18next"; const ListItem = ({ photo, title, onPress, publishedAt }) => { const { colors } = useTheme(); const { t } = useTranslation(); 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)} {t('common.readMore')} ); }; 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;