import { Badge, type BadgeProps, Stat as ChakraStat, FormatNumber, } from "@chakra-ui/react" import { InfoTip } from "compositions/ui/toggle-tip" import * as React from "react" interface StatLabelProps extends ChakraStat.LabelProps { info?: React.ReactNode } export const StatLabel = React.forwardRef( function StatLabel(props, ref) { const { info, children, ...rest } = props return ( {children} {info && {info}} ) }, ) interface StatValueTextProps extends ChakraStat.ValueTextProps { value?: number formatOptions?: Intl.NumberFormatOptions } export const StatValueText = React.forwardRef< HTMLDivElement, StatValueTextProps >(function StatValueText(props, ref) { const { value, formatOptions, children, ...rest } = props return ( {children || (value != null && )} ) }) export const StatUpTrend = React.forwardRef( function StatUpTrend(props, ref) { return ( {props.children} ) }, ) export const StatDownTrend = React.forwardRef( function StatDownTrend(props, ref) { return ( {props.children} ) }, ) export const StatRoot = ChakraStat.Root export const StatHelpText = ChakraStat.HelpText export const StatValueUnit = ChakraStat.ValueUnit