import { IonIcon, IonItem, IonItemOption, IonItemOptions, IonItemSliding, IonNavLink, IonText, IonThumbnail, } from '@ionic/react'; import { checkmarkDone } from 'ionicons/icons'; import ChatHelloworld from '../../pages/chat'; import { ContactStore } from '../../store'; import { getContacts } from '../../store/Selectors'; import HKPartyIonDeleteIcon from '../HKPartyIonDeleteIcon'; import './style.scss'; const ChatItem = ({ chat }) => { const contacts = ContactStore.useState(getContacts); const { chats, contact_id } = chat; const { read, date, preview, received } = chats[chats.length - 1]; const contact = contacts.filter(c => c.id === contact_id)[0]; const notificationCount = chats.filter(chat => chat.read === false).length; return ( <> {/* Archive */} {/* */} }> Silhouette of mountains
{contact.name} {read && received && } {preview}
{date} {notificationCount > 0 && {notificationCount}}
{/* */}
); }; export default ChatItem;