// @flow import * as React from 'react'; import classnames from 'classnames'; import HappyYrbl from './gerbil-happy.png'; import SadYrbl from './gerbil-sad.png'; type Props = { title?: string, subtitle?: string | React.Node, type: string, className?: string, }; const yrblTypes = { happy: HappyYrbl, sad: SadYrbl, }; export default class extends React.PureComponent { static defaultProps = { type: 'happy', }; render() { const { title, subtitle, type, className } = this.props; const image = yrblTypes[type]; return (
Friendly gerbil {title && subtitle && (

{title}

{subtitle}

)}
); } }