// @flow
import React from 'react';
import type { App } from '../../types';
import {
AppMeta,
AppRowContainer,
AppIcon,
AppName,
AppSourcesList,
AppSourcesListItem,
AppSourcesLabel,
} from './style';
import Offer from './Offer';
import Icon from '../Icon';
type Props = {
app: App,
};
export const AppRow = ({ app }: Props) => {
const sourcesKeys = app.sources && Object.keys(app.sources);
const renderSourceIcon = (key: string) => {
const sourceUrl = app.sources[key];
const renderMatch = key.toLowerCase();
const hideOnMobile =
renderMatch === 'linux' ||
renderMatch === 'macos' ||
renderMatch === 'windows';
return (
{renderMatch}
);
};
return (
{app.image && }
{app.name}
{sourcesKeys && (
{sourcesKeys.map(renderSourceIcon)}
)}
{app.offer && }
);
};