import * as React from 'react'; import { BlueRain, BlueRainConsumer } from '@blueeast/bluerain-os'; import { style } from './style'; import getAppList from '../../helpers/getAppList'; export interface AppCardProperties { name: string, link: string, slug?: string, size: number, } class AppCard extends React.PureComponent{ render() { const { name, link, size, slug } = this.props; return ( {(BR: BlueRain) => { const appsList = getAppList(BR); // check if the app exists let appFound = false; appsList.forEach((each) => { if (each.slug === slug) { appFound = true; } }); return ( {slug && appFound ? BR.Apps.getIconElement(slug, { size }) : null} {name} ); }} ); } } export default AppCard;