import * as React from 'react'; import { SingleComponent } from '../context/DataStore'; interface MoreLikeThisProps { docs: T[]; title?: string; render: SingleComponent; } class MoreLikeThis extends React.Component> { render() { const { docs, render } = this.props; const titleDiv = this.props.title ? (

{this.props.title}

) : null; return (
{titleDiv} { (docs || []).map( (doc, i) =>
{render(doc)}
) }
); } } export { MoreLikeThisProps, MoreLikeThis };