import React from 'react'; import { Tooltip } from '../../Components'; import Spinnable from '../Shared/Spinnable'; import { memoize } from 'lodash/fp'; interface StepAnalysisTileProps { shortDescription: string; customThumbnailUrl?: string; displayName: string; inactive: boolean; newRelease: boolean; loading: boolean; loadChoice: () => void; } const TOOLTIP_POSITION = { my: "top center", at: "bottom center" }; export const StepAnalysisTile: React.SFC = ({ shortDescription, customThumbnailUrl, displayName, inactive, newRelease, loading, loadChoice }) => (
{ inactive &&
Coming soon...
} { newRelease &&
}
{displayName}

{shortDescription}

); const ENTER_KEY_CODE = 13; const onKeyDownFactory = memoize((loadChoice: () => void) => (event: React.KeyboardEvent) => { if (event.which === ENTER_KEY_CODE) { loadChoice(); } }); const NOOP = () => { }; const tileStyle = (customThumbnailUrl?: string): React.CSSProperties => customThumbnailUrl ? { backgroundImage: `url(${customThumbnailUrl})`, height: '140px' } : { height: '140px' };