Sha256: 3a04f58d3f45cf4b1721b06d9217784a5bed294334438535c4b0c71365fed6ce
Contents?: true
Size: 842 Bytes
Versions: 11
Compression:
Stored size: 842 Bytes
Contents
/* @flow */ import React from 'react' import classnames from 'classnames' import {Title} from '../' type StatValueProps = { className?: String, id?: String, unit?: String, value: String | Number } const StatValue = (props: StatValueProps) => { const { className, id, unit, value=0 } = props const displayValue = function(value) { if (value) { return ( <Title size={1} text={value} /> ) } } const displayUnit = function(unit) { if (unit) { return ( <Title size={3} text={unit} /> ) } } return ( <div id={id} className={classnames('pb_stat_value_kit', className)}> <div className="pb_stat_value_wrapper"> {displayValue(value)} {displayUnit(unit)} </div> </div> ) } export default StatValue
Version data entries
11 entries across 11 versions & 1 rubygems