Sha256: 8392cae9ee79a34ed9af4cd535925c9a546d0e4556252bb41287d39be47ab5f7
Contents?: true
Size: 1.48 KB
Versions: 37
Compression:
Stored size: 1.48 KB
Contents
/* @flow */ import React from 'react' import classnames from 'classnames' import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props' import { globalProps } from '../utilities/globalProps.js' import { Body, StatChange, StatValue, } from '../' type DashboardValueProps = { align?: 'left' | 'center' | 'right', aria?: object, className?: string, data?: object, id?: string, statChange?: { change?: string, value?: string | Number }, statLabel?: string, statValue?: { unit?: string, value?: string | Number } } const DashboardValue = (props: DashboardValueProps) => { const { align = 'left', aria = {}, className, data = {}, id, statChange = {}, statLabel, statValue = {}, } = props const ariaProps = buildAriaProps(aria) const dataProps = buildDataProps(data) const classes = classnames(buildCss('pb_dashboard_value_kit', align), className, globalProps(props)) return ( <div {...ariaProps} {...dataProps} className={classes} 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
37 entries across 37 versions & 1 rubygems