import classNames from 'classnames' import { ReactElement, ReactNode } from 'react' import { Tooltip } from 'components/Tooltip' import useStore from 'store' import { FormattedNumber } from 'components/FormattedNumber' interface Props { tooltip: string | ReactNode strokeColor?: string strokeWidth?: number background?: string diameter?: number percentage: number labelClassName?: string icon?: ReactElement } export const Gauge = ({ background = '#FFFFFF22', strokeColor, strokeWidth = 4, diameter = 40, percentage = 0, tooltip, icon, labelClassName, }: Props) => { const enableAnimations = useStore((s) => s.enableAnimations) const radius = 16 const percentageValue = percentage > 100 ? 100 : percentage < 0 ? 0 : percentage const circlePercent = 100 - percentageValue return (
{!strokeColor && ( )} {icon && (
{icon}
)}
) }