@@ -17,108 +17,80 @@ export default function CoinHeader({
1717
1818 return (
1919 < div className = 'coin-header-container' >
20- { name ? (
21- < div className = 'coin-header-container' >
22- < h3 className = 'text-3xl font-medium' > { name } </ h3 >
23- < div className = 'coin-header-info' >
24- < Image
25- src = { image }
26- alt = { name }
27- width = { 77 }
28- height = { 77 }
29- className = 'coin-header-image'
30- />
31- < div className = 'flex gap-4' >
32- < h1 className = 'coin-header-price' > { formatPrice ( livePrice ) } </ h1 >
33- < Badge
34- className = { cn (
35- 'coin-header-badge' ,
36- isTrendingUp
37- ? 'bg-green-600/20 text-green-600'
38- : 'bg-red-500/20 text-red-500'
39- ) }
40- >
41- { formatPercentage ( livePriceChangePercentage24h ) }
42- { isTrendingUp ? < TrendingUp /> : < TrendingDown /> }
43- (24h)
44- </ Badge >
45- </ div >
20+ < div className = 'coin-header-container' >
21+ < h3 className = 'text-3xl font-medium' > { name } </ h3 >
22+ < div className = 'coin-header-info' >
23+ < Image
24+ src = { image }
25+ alt = { name }
26+ width = { 77 }
27+ height = { 77 }
28+ className = 'coin-header-image'
29+ />
30+ < div className = 'flex gap-4' >
31+ < h1 className = 'coin-header-price' > { formatPrice ( livePrice ) } </ h1 >
32+ < Badge
33+ className = { cn (
34+ 'coin-header-badge' ,
35+ isTrendingUp
36+ ? 'bg-green-600/20 text-green-600'
37+ : 'bg-red-500/20 text-red-500'
38+ ) }
39+ >
40+ { formatPercentage ( livePriceChangePercentage24h ) }
41+ { isTrendingUp ? < TrendingUp /> : < TrendingDown /> }
42+ (24h)
43+ </ Badge >
4644 </ div >
47- < div className = 'coin-header-stats' >
48- < div className = 'coin-header-stat ' >
49- < p className = 'coin-header-stat-label' > Today </ p >
50- < div
51- className = { cn ( 'coin-header-stat-value' , {
52- 'text-green-500' : livePriceChangePercentage24h > 0 ,
53- 'text-red -500' : livePriceChangePercentage24h < 0 ,
54- } ) }
55- >
56- < p > { formatPercentage ( livePriceChangePercentage24h ) } </ p >
57- { isTrendingUp ? (
58- < TrendingUp width = { 16 } height = { 16 } />
59- ) : (
60- < TrendingDown width = { 16 } height = { 16 } />
61- ) }
62- </ div >
45+ </ div >
46+ < div className = 'coin-header-stats ' >
47+ < div className = 'coin-header-stat' >
48+ < p className = 'coin-header-stat-label' > Today </ p >
49+ < div
50+ className = { cn ( 'coin-header-stat-value' , {
51+ 'text-green -500' : livePriceChangePercentage24h > 0 ,
52+ 'text-red-500' : livePriceChangePercentage24h < 0 ,
53+ } ) }
54+ >
55+ < p > { formatPercentage ( livePriceChangePercentage24h ) } </ p >
56+ { isTrendingUp ? (
57+ < TrendingUp width = { 16 } height = { 16 } />
58+ ) : (
59+ < TrendingDown width = { 16 } height = { 16 } />
60+ ) }
6361 </ div >
62+ </ div >
6463
65- < div className = 'coin-header-stat' >
66- < p className = 'coin-header-stat-label' > 30 Days</ p >
67- < div
68- className = { cn ( 'coin-header-stat-value-30d' , {
69- 'text-green-500' : priceChangePercentage30d > 0 ,
70- 'text-red-500' : priceChangePercentage30d < 0 ,
71- } ) }
72- >
73- < p > { formatPercentage ( priceChangePercentage30d ) } </ p >
74- { isTrendingUp ? (
75- < TrendingUp width = { 16 } height = { 16 } />
76- ) : (
77- < TrendingDown width = { 16 } height = { 16 } />
78- ) }
79- </ div >
64+ < div className = 'coin-header-stat' >
65+ < p className = 'coin-header-stat-label' > 30 Days</ p >
66+ < div
67+ className = { cn ( 'coin-header-stat-value-30d' , {
68+ 'text-green-500' : priceChangePercentage30d > 0 ,
69+ 'text-red-500' : priceChangePercentage30d < 0 ,
70+ } ) }
71+ >
72+ < p > { formatPercentage ( priceChangePercentage30d ) } </ p >
73+ { isTrendingUp ? (
74+ < TrendingUp width = { 16 } height = { 16 } />
75+ ) : (
76+ < TrendingDown width = { 16 } height = { 16 } />
77+ ) }
8078 </ div >
79+ </ div >
8180
82- < div className = 'text-base flex flex-col gap-2' >
83- < p className = 'coin-header-stat-label' > Price Change (24h)</ p >
84- < p
85- className = { cn ( 'coin-header-stat-price' , {
86- 'text-green-500' : priceChange24h > 0 ,
87- 'text-red-500' : priceChange24h < 0 ,
88- } ) }
89- >
90- { formatPrice ( priceChange24h ) }
91- </ p >
92- </ div >
81+ < div className = 'text-base flex flex-col gap-2' >
82+ < p className = 'coin-header-stat-label' > Price Change (24h)</ p >
83+ < p
84+ className = { cn ( 'coin-header-stat-price' , {
85+ 'text-green-500' : priceChange24h > 0 ,
86+ 'text-red-500' : priceChange24h < 0 ,
87+ } ) }
88+ >
89+ { formatPrice ( priceChange24h ) }
90+ </ p >
9391 </ div >
9492 </ div >
95- ) : (
96- < >
97- < div className = 'coin-header-info' >
98- < div className = 'coin-header-skeleton-image' />
99- < div className = 'flex gap-4' >
100- < div className = 'coin-header-skeleton-price' />
101- < div className = 'coin-header-skeleton-badge' />
102- </ div >
103- </ div >
104- < div className = 'coin-header-stats' >
105- { [ 1 , 2 , 3 ] . map ( ( i ) => (
106- < div
107- key = { i }
108- className = { cn (
109- 'text-base flex flex-col gap-2' ,
110- i < 3 && 'border-r border-purple-600'
111- ) }
112- >
113- < p className = 'coin-header-stat-label' >
114- { i === 1 ? 'Today' : i === 2 ? 'Market Cap' : 'Volume 24h' }
115- </ p >
116- < div className = 'coin-header-skeleton-stat' />
117- </ div >
118- ) ) }
119- </ div >
120- </ >
121- ) }
93+ </ div >
12294 </ div >
12395 ) ;
12496}
0 commit comments