From 714adc4d6052db10af509a91365ae493c4059cd5 Mon Sep 17 00:00:00 2001 From: Kilter Date: Thu, 29 Jun 2023 08:53:25 -0500 Subject: [PATCH] warning validation --- src/components/views/UserInfo.tsx | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/components/views/UserInfo.tsx b/src/components/views/UserInfo.tsx index 4d2e0b6..44cc145 100644 --- a/src/components/views/UserInfo.tsx +++ b/src/components/views/UserInfo.tsx @@ -32,6 +32,19 @@ export function UserInfo() { const claimableRewards = weiToEth(onChainProofQuery.data?.claimableRewardsWei) const pendingRewards = weiToEth(onChainProofQuery.data?.pendingRewardsWei) + const setWarning = (status: string) => { + switch (status) { + case 'yellowcard': + return 'yellow' + case 'redcard': + return 'red' + case 'banned': + return 'banned' + default: + return 'none' + } + } + let tableData: Validator[] = [] if (validatorsQuery.data) { tableData = validatorsQuery.data.map( @@ -48,7 +61,7 @@ export function UserInfo() { subscribed: status === 'active', validatorId: validatorIndex, validatorKey: validatorKey as `0x${string}`, - warning: 'none', + warning: setWarning(status), }) ) }