// @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];
if (key === 'windows') {
return (
Windows
);
}
if (key === 'ios') {
return (
iOS
);
}
if (key === 'macos') {
return (
macOS
);
}
if (key === 'android') {
return (
Android
);
}
return null;
};
return (
{app.image && }
{app.name}
{sourcesKeys && (
{sourcesKeys.map(renderSourceIcon)}
)}
{app.offer && }
);
};