import React from 'react'; import { ConversationListItem, PropsData as ConversationListItemPropsType, } from './ConversationListItem'; import { PropsData as SearchResultsProps, SearchResults, } from './SearchResults'; import { LocalizerType } from '../types/Util'; export interface Props { conversations?: Array; searchResults?: SearchResultsProps; i18n: LocalizerType; // Action Creators startNewConversation: () => void; openConversationInternal: (id: string, messageId?: string) => void; // Render Props renderMainHeader: () => JSX.Element; } export class LeftPane extends React.Component { public renderList() { const { conversations, i18n, openConversationInternal, startNewConversation, searchResults, } = this.props; if (searchResults) { return ( ); } return (
{(conversations || []).map(conversation => ( ))}
); } public render() { const { renderMainHeader } = this.props; return (
{renderMainHeader()}
{this.renderList()}
); } }