Sha256: 3f875608ea3bfadac2b9752a0a28df64ad3de3e06df1b9668bc65d28a3246e70
Contents?: true
Size: 1.04 KB
Versions: 38
Compression:
Stored size: 1.04 KB
Contents
/* @flow */ import React from 'react' import classnames from 'classnames' import { buildCss } from '../utilities/props' import { Body, Icon } from '../' const statusMap = { 'increase': 'positive', 'decrease': 'negative', } const iconMap = { 'increase': 'arrow-up', 'decrease': 'arrow-down', } type StatChangeProps = { change?: 'increase' | 'decrease' | 'neutral', className?: String, id?: String, value?: String | Number } const StatChange = ({ change = 'neutral', className, id, value, }: StatChangeProps) => { const status = statusMap[change] || 'neutral' const icon = iconMap[change] return ( <If condition={value}> <div className={classnames(className, buildCss('pb_stat_change_kit', status))} id={id} > <Body status={status}> <If condition={icon}> <Icon fixed_width icon={icon} /> {' '} </If> {`${value}%`} </Body> </div> </If> ) } export default StatChange
Version data entries
38 entries across 38 versions & 1 rubygems