Sha256: 56e30ee09386038e08a341fbde92330a0be50759062120175292a8989c1a7fcc
Contents?: true
Size: 1.09 KB
Versions: 302
Compression:
Stored size: 1.09 KB
Contents
import React from 'react' import classnames from 'classnames' import { globalProps } from '../utilities/globalProps' import Title from '../pb_title/_title' type StatValueProps = { className?: string, id?: string, unit?: string, value: string | number, } const StatValue = (props: StatValueProps): React.ReactElement => { const { className, id, unit, value = 0, } = props const displayValue = function(value: string | number) { if (value || value === 0) { return ( <Title size={1} tag="span" text={`${value}`} /> ) } } const displayUnit = function(unit: string) { 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
302 entries across 302 versions & 1 rubygems