Sha256: d24fdc2b5534ffae47b09a05f78bfbd947e54b2e11da351b0cfadfabca9e97ae
Contents?: true
Size: 932 Bytes
Versions: 38
Compression:
Stored size: 932 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 className={classnames('pb_stat_value_kit', className)} id={id} > <div className="pb_stat_value_wrapper"> {displayValue(value)} {displayUnit(unit)} </div> </div> ) } export default StatValue
Version data entries
38 entries across 38 versions & 1 rubygems