You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

29 lines
1.1 KiB

import { DiaryEntry } from '@/types/entry';
import { Pressable } from './ui/pressable';
import { Image } from './ui/image';
import { Box } from './ui/box';
import { Text } from './ui/text';
import { formatDateHuman } from '@/utils/date';
export function EntryCard({ item, onPress }: { item: DiaryEntry; onPress: () => void }) {
return (
<Pressable className="flex-row items-center gap-3 rounded-2xl bg-white p-3" onPress={onPress}>
{item.imageUri ? (
<Image className="h-14 w-14 rounded-xl" source={{ uri: item.imageUri }} />
) : (
<Box className="h-14 w-14 items-center justify-center rounded-xl bg-neutral-200">
<Text>🖼</Text>
</Box>
)}
<Box className="flex-1">
<Text className="flex-1">
{item.mood}{' '}
<Text className="text-sm text-neutral-500">{formatDateHuman(item.dateTimeISO)}</Text>
<Text className="text-neutral-700" numberOfLines={1}>
{item.text}
</Text>
</Text>
</Box>
</Pressable>
);
}