import React from 'react'; import { ConversationListItemProps, MemoConversationListItemWithDetails, } from './ConversationListItem'; export type SearchResultsProps = { contacts: Array; conversations: Array; hideMessagesHeader: boolean; searchTerm: string; }; const ContactsItem = (props: { header: string; items: Array }) => { return (
{props.header}
{props.items.map(contact => ( ))}
); }; export const SearchResults = (props: SearchResultsProps) => { const { conversations, contacts, searchTerm } = props; const haveConversations = conversations && conversations.length; const haveContacts = contacts && contacts.length; const noResults = !haveConversations && !haveContacts; return (
{noResults ? (
{window.i18n('noSearchResults', [searchTerm])}
) : null} {haveConversations ? (
{window.i18n('conversationsHeader')}
{conversations.map(conversation => ( ))}
) : null} {haveContacts ? ( ) : null} {/* {haveMessages ? (
{hideMessagesHeader ? null : (
{window.i18n('messagesHeader')}
)} {messages.map(message => ( ))}
) : null} */}
); };