import { useState, useEffect } from 'react'; import {CaretUpOutlined, CaretDownOutlined} from '@ant-design/icons' export const ValueDisplay = ({prefix, value, suffix, isArrowVisible}) =>{ const [oldVal, setOldVal] = useState(NaN) const [val, setVal] = useState('---') let arrow = null useEffect(()=>{ if(value) if(Number.isFinite(+value)){ setVal((+value).toPrecision(4)??'---') if (isArrowVisible) { if (value > oldVal) arrow = else if (value < oldVal) arrow = setOldVal(value) } } else setVal(value) },[value]) return({prefix} {val} {suffix}{arrow}) } export const Display = (props)=>{ const {label} = props return
{label}
}