import {computed} from 'mobx'; import {observer} from 'mobx-react'; import * as React from 'react'; import {Intent} from '../../interfaces'; import styles from './Card.scss'; import classNames from 'classnames'; interface CardProps { active?: boolean; onClick?: () => void; intent?: Intent; className?: string; } @observer export class Card extends React.Component { @computed private get intentStyle() { const {intent = Intent.SUCCESS} = this.props; const intentStyleMap = { [Intent.SUCCESS]: styles.intentSuccess, [Intent.PRIMARY]: styles.intentPrimary, [Intent.SECONDARY]: styles.intentSecondary, [Intent.WARNING]: styles.intentWarning, [Intent.DANGER]: styles.intentDanger }; return intentStyleMap[intent]; } public render() { const {active, onClick, className, children} = this.props; return (
{children}
); } }