@@ -33,83 +33,83 @@ interface IStat {
3333 icon : React . FC < React . SVGAttributes < SVGElement > > ;
3434}
3535
36- const Stats = ( ) => {
37- const stats : IStat [ ] = [
38- {
39- title : "Min Stake" ,
40- coinId : 0 ,
41- getText : ( data ) => commify ( formatUnits ( data ?. minStake , 18 ) ) ,
42- getSubtext : ( data , coinPrice ) =>
43- ( parseInt ( formatUnits ( data ?. minStake , 18 ) ) * ( coinPrice ?? 0 ) ) . toFixed ( 2 ) . toString ( ) + "$" ,
44- color : "purple" ,
45- icon : MinStake ,
46- } ,
47- {
48- title : "Vote Stake" ,
49- coinId : 0 ,
50- getText : ( data ) => commify ( formatUnits ( data ?. minStake , 18 ) ) ,
51- getSubtext : ( data , coinPrice ) =>
52- ( parseInt ( formatUnits ( data ?. minStake , 18 ) ) * ( coinPrice ?? 0 ) ) . toFixed ( 2 ) . toString ( ) + "$" ,
53- color : "purple" ,
54- icon : VoteStake ,
55- } ,
56- {
57- title : "Active Jurors" ,
58- getText : ( data ) => data ?. numberStakedJurors ,
59- getSubtext : ( ) => "" ,
60- color : "purple" ,
61- icon : PNKRedistributedIcon ,
62- } ,
63- {
64- title : "PNK Staked" ,
65- coinId : 0 ,
66- getText : ( data ) => commify ( formatUnits ( data ?. stake , 18 ) ) ,
67- getSubtext : ( data , coinPrice ) =>
68- ( parseInt ( formatUnits ( data ?. stake , 18 ) ) * ( coinPrice ?? 0 ) ) . toFixed ( 2 ) . toString ( ) + "$" ,
69- color : "purple" ,
70- icon : PNKIcon ,
71- } ,
72- {
73- title : "Cases" ,
74- getText : ( data ) => data ?. numberDisputes ,
75- getSubtext : ( ) => "" ,
76- color : "orange" ,
77- icon : BalanceIcon ,
78- } ,
79- {
80- title : "In Progress" ,
81- getText : ( data ) => data ?. numberDisputes ,
82- getSubtext : ( ) => "" ,
83- color : "orange" ,
84- icon : BalanceIcon ,
85- } ,
86- {
87- title : "ETH paid to Jurors" ,
88- coinId : 1 ,
89- getText : ( data ) => commify ( formatEther ( data ?. paidETH ) ) ,
90- getSubtext : ( data , coinPrice ) =>
91- ( parseInt ( formatUnits ( data ?. paidETH , 18 ) ) * ( coinPrice ?? 0 ) ) . toFixed ( 2 ) . toString ( ) + "$" ,
92- color : "blue" ,
93- icon : EthereumIcon ,
94- } ,
95- {
96- title : "PNK redistributed" ,
97- coinId : 0 ,
98- getText : ( data ) => commify ( formatUnits ( data ?. paidPNK , 18 ) ) ,
99- getSubtext : ( data , coinPrice ) =>
100- ( parseInt ( formatUnits ( data ?. paidPNK , 18 ) ) * ( coinPrice ?? 0 ) ) . toFixed ( 2 ) . toString ( ) + "$" ,
101- color : "purple" ,
102- icon : PNKRedistributedIcon ,
103- } ,
104- ] ;
36+ const stats : IStat [ ] = [
37+ {
38+ title : "Min Stake" ,
39+ coinId : 0 ,
40+ getText : ( data ) => commify ( formatUnits ( data ?. minStake , 18 ) ) ,
41+ getSubtext : ( data , coinPrice ) =>
42+ ( parseInt ( formatUnits ( data ?. minStake , 18 ) ) * ( coinPrice ?? 0 ) ) . toFixed ( 2 ) . toString ( ) + "$" ,
43+ color : "purple" ,
44+ icon : MinStake ,
45+ } ,
46+ {
47+ title : "Vote Stake" ,
48+ coinId : 0 ,
49+ getText : ( data ) => commify ( formatUnits ( data ?. minStake , 18 ) ) ,
50+ getSubtext : ( data , coinPrice ) =>
51+ ( parseInt ( formatUnits ( data ?. minStake , 18 ) ) * ( coinPrice ?? 0 ) ) . toFixed ( 2 ) . toString ( ) + "$" ,
52+ color : "purple" ,
53+ icon : VoteStake ,
54+ } ,
55+ {
56+ title : "Active Jurors" ,
57+ getText : ( data ) => data ?. numberStakedJurors ,
58+ getSubtext : ( ) => "" ,
59+ color : "purple" ,
60+ icon : PNKRedistributedIcon ,
61+ } ,
62+ {
63+ title : "PNK Staked" ,
64+ coinId : 0 ,
65+ getText : ( data ) => commify ( formatUnits ( data ?. stake , 18 ) ) ,
66+ getSubtext : ( data , coinPrice ) =>
67+ ( parseInt ( formatUnits ( data ?. stake , 18 ) ) * ( coinPrice ?? 0 ) ) . toFixed ( 2 ) . toString ( ) + "$" ,
68+ color : "purple" ,
69+ icon : PNKIcon ,
70+ } ,
71+ {
72+ title : "Cases" ,
73+ getText : ( data ) => data ?. numberDisputes ,
74+ getSubtext : ( ) => "" ,
75+ color : "orange" ,
76+ icon : BalanceIcon ,
77+ } ,
78+ {
79+ title : "In Progress" ,
80+ getText : ( data ) => data ?. numberDisputes ,
81+ getSubtext : ( ) => "" ,
82+ color : "orange" ,
83+ icon : BalanceIcon ,
84+ } ,
85+ {
86+ title : "ETH paid to Jurors" ,
87+ coinId : 1 ,
88+ getText : ( data ) => commify ( formatEther ( data ?. paidETH ) ) ,
89+ getSubtext : ( data , coinPrice ) =>
90+ ( parseInt ( formatUnits ( data ?. paidETH , 18 ) ) * ( coinPrice ?? 0 ) ) . toFixed ( 2 ) . toString ( ) + "$" ,
91+ color : "blue" ,
92+ icon : EthereumIcon ,
93+ } ,
94+ {
95+ title : "PNK redistributed" ,
96+ coinId : 0 ,
97+ getText : ( data ) => commify ( formatUnits ( data ?. paidPNK , 18 ) ) ,
98+ getSubtext : ( data , coinPrice ) =>
99+ ( parseInt ( formatUnits ( data ?. paidPNK , 18 ) ) * ( coinPrice ?? 0 ) ) . toFixed ( 2 ) . toString ( ) + "$" ,
100+ color : "purple" ,
101+ icon : PNKRedistributedIcon ,
102+ } ,
103+ ] ;
105104
105+ const Stats = ( ) => {
106106 const { id } = useParams ( ) ;
107107 const { data } = useCourtDetails ( id ) ;
108108 const { prices } = useCoinPrice ( [ "kleros" , "ethereum" ] ) ;
109109 return (
110110 < StyledCard >
111111 { stats . map ( ( { title, coinId, getText, getSubtext, color, icon } , i ) => {
112- const coinPrice = prices && ! isUndefined ( coinId ) ? prices [ coinId ] . usd : undefined ;
112+ const coinPrice = prices && ! isUndefined ( coinId ) ? prices [ coinId ] : undefined ;
113113 return (
114114 < StatDisplay
115115 key = { i }
0 commit comments