import * as React from 'react' ; import { StoreActions } from '../../actions.d' ; import { DSEntity } from 'compactd-models' ; import BetterImage from 'components/BetterImage' ; import { ArtistComponent , AlbumComponent } from 'components' ; require ( './ResultItem.scss' ) ; interface ResultItemProps { actions : StoreActions ; item : DSEntity ; } export class ResultItem extends React . Component < ResultItemProps , { } > { render ( ) { const { item , actions } = this . props ; switch ( item . type ) { case 'artist' : return < div className = "result-item" key = { item . id } > { } < /div>; case 'album' : return < div className = "result-item" key = { item . id } > { } < /div>; case 'track' : return < div className = "result-item item-track" key = { item . id } > < span className = "track-name" > { item . name } < /span> < span className = "track-artist" > { item . artist } < /span> < /div>; } } }