Sha256: b82d36273a2554f73457f7f9f157aa7a468886c4db35fdd46b46413171465cab
Contents?: true
Size: 1.31 KB
Versions: 31
Compression:
Stored size: 1.31 KB
Contents
/* @flow */ import React from 'react' import classnames from 'classnames' import { spacing } from '../utilities/spacing.js' import { Body, StatChange, StatValue, } from '../' type DashboardValueProps = { align?: 'left' | 'center' | 'right', className?: String, id?: String, statChange?: { change?: String, value?: String | Number }, statLabel?: String, statValue?: { unit?: String, value?: String | Number } } const dashboardValueCSS = ({ align = 'left', }: DashboardValueProps) => { const alignStyle = align !== '' ? `_${align}` : '' return 'pb_dashboard_value_kit' + alignStyle } const DashboardValue = (props: DashboardValueProps) => { const { className, id, statChange, statLabel, statValue, } = props return ( <div className={classnames(dashboardValueCSS(props), className, spacing(props))} id={id} > <If condition={statLabel}> <Body color="light">{statLabel}</Body> </If> <If condition={statValue}> <StatValue unit={statValue.unit} value={statValue.value} /> </If> <If condition={statChange}> <StatChange change={statChange.change} value={statChange.value} /> </If> </div> ) } export default DashboardValue
Version data entries
31 entries across 31 versions & 1 rubygems