import { CLUSTER } from '@store/mangoStore'
import { formatNumericValue } from 'utils/numbers'
import { tpsAlertThreshold, tpsWarningThreshold } from './StatusBar'
const Tps = ({ tps }: { tps: number }) => {
if (CLUSTER == 'mainnet-beta') {
return (
{formatNumericValue(tps, 0)}
)
} else {
return null
}
}
export default Tps
export const StatusDot = ({
status,
alert,
warning,
isLessThan,
}: {
status: number
alert: number
warning: number
isLessThan?: boolean
}) => {
const greaterOrLessThan = (status: number, threshold: number) => {
if (isLessThan) {
return status < threshold
} else return status > threshold
}
const dotColor = greaterOrLessThan(status, warning)
? 'bg-th-error'
: greaterOrLessThan(status, alert)
? 'bg-th-warning'
: 'bg-th-success'
return (
)
}