@@ -55,34 +55,33 @@ export default async function NodePerformanceCard({
5555 value = {
5656 < div className = "row gap-6" >
5757 < div className = "row gap-1" >
58- { nodeResponse . epochs . slice ( - 10 ) . map ( ( epoch , index ) => (
59- < div key = { index } >
60- < Tooltip
61- content = {
62- < div className = "px-1 py-1.5 text-small" >
63- < div className = "font-semibold" >
64- { parseFloat (
65- ( ( nodeResponse . epochs_vals [ index ] * 100 ) / 255 ) . toFixed ( 2 ) ,
66- ) }
67- %
58+ { nodeResponse . epochs . slice ( - 10 ) . map ( ( epoch , index ) => {
59+ const availability = nodeResponse . epochs_vals . slice ( - 10 ) [ index ] ;
60+
61+ return (
62+ < div key = { index } >
63+ < Tooltip
64+ content = {
65+ < div className = "px-1 py-1.5 text-small" >
66+ < div className = "font-semibold" >
67+ { parseFloat ( ( ( availability * 100 ) / 255 ) . toFixed ( 2 ) ) } %
68+ </ div >
69+ < div className = "text-slate-500" > Epoch { epoch } </ div >
6870 </ div >
69- < div className = "text-slate-500" > Epoch { epoch } </ div >
70- </ div >
71- }
72- closeDelay = { 0 }
73- >
74- < div
75- className = { clsx ( 'h-5 w-5 cursor-pointer rounded-md hover:opacity-70' , {
76- 'bg-teal-500' : nodeResponse . epochs_vals [ index ] >= 200 ,
77- 'bg-yellow-500' :
78- nodeResponse . epochs_vals [ index ] >= 100 &&
79- nodeResponse . epochs_vals [ index ] < 200 ,
80- 'bg-red-500' : nodeResponse . epochs_vals [ index ] < 100 ,
81- } ) }
82- > </ div >
83- </ Tooltip >
84- </ div >
85- ) ) }
71+ }
72+ closeDelay = { 0 }
73+ >
74+ < div
75+ className = { clsx ( 'h-5 w-5 cursor-pointer rounded-md hover:opacity-70' , {
76+ 'bg-teal-500' : availability >= 200 ,
77+ 'bg-yellow-500' : availability >= 100 && availability < 200 ,
78+ 'bg-red-500' : availability < 100 ,
79+ } ) }
80+ > </ div >
81+ </ Tooltip >
82+ </ div >
83+ ) ;
84+ } ) }
8685 </ div >
8786
8887 < div className = "h-[40px] w-[200px]" >
0 commit comments