Sha256: 9a9e59a22ae9b14ab13730edf3f52dfbd7dcfb08f0ced450cf2f8e29ea34c6d1
Contents?: true
Size: 1.05 KB
Versions: 48
Compression:
Stored size: 1.05 KB
Contents
/* @flow */ import React from 'react' import classnames from 'classnames' import { Title } from '../' import { globalProps } from '../utilities/globalProps.js' 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 || value === 0) { return ( <Title size={1} tag="span" text={`${value}`} /> ) } } const displayUnit = function(unit) { if (unit) { return ( <Title size={3} tag="span" text={unit} /> ) } } return ( <div className={classnames('pb_stat_value_kit', globalProps(props), className)} id={id} > <div className="pb_stat_value_wrapper"> {displayValue(value)} {displayUnit(unit)} </div> </div> ) } export default StatValue
Version data entries
48 entries across 48 versions & 1 rubygems