|
| 1 | +import { DataTable } from '@/components/DataTable'; |
1 | 2 | import { Skeleton } from '../ui/skeleton'; |
2 | | -import { |
3 | | - Table, |
4 | | - TableBody, |
5 | | - TableCell, |
6 | | - TableHead, |
7 | | - TableHeader, |
8 | | - TableRow, |
9 | | -} from '../ui/table'; |
10 | 3 |
|
11 | 4 | export const CategoriesFallback = () => ( |
12 | 5 | <div id='categories-fallback' className='custom-scrollbar'> |
13 | 6 | <h4>Top Categories</h4> |
14 | | - <Table> |
15 | | - <TableHeader className='header'> |
16 | | - <TableRow className='header-row'> |
17 | | - <TableHead className='head head-left'>Category</TableHead> |
18 | | - <TableHead className='head'>Top Gainers</TableHead> |
19 | | - <TableHead className='head head-change'>24h Change</TableHead> |
20 | | - <TableHead className='head'>Market Cap</TableHead> |
21 | | - <TableHead className='head'>24h Volume</TableHead> |
22 | | - </TableRow> |
23 | | - </TableHeader> |
24 | | - <TableBody> |
25 | | - {Array.from({ length: 6 }).map((_, index) => ( |
26 | | - <TableRow key={index} className='row'> |
27 | | - <TableCell className='category-cell'> |
28 | | - <Skeleton className='skeleton category-skeleton' /> |
29 | | - </TableCell> |
30 | | - <TableCell className='gainers-cell'> |
31 | | - {Array.from({ length: 3 }).map((__, coinIndex) => ( |
32 | | - <Skeleton |
33 | | - key={coinIndex} |
34 | | - className='skeleton coin-skeleton' |
35 | | - /> |
36 | | - ))} |
37 | | - </TableCell> |
38 | | - <TableCell className='value-cell'> |
| 7 | + <DataTable |
| 8 | + tableClassName='mt-3' |
| 9 | + columns={[ |
| 10 | + { |
| 11 | + header: 'Category', |
| 12 | + cellClassName: 'category-cell', |
| 13 | + cell: () => <Skeleton className='skeleton category-skeleton' />, |
| 14 | + }, |
| 15 | + { |
| 16 | + header: 'Top Gainers', |
| 17 | + cellClassName: 'top-gainers-cell', |
| 18 | + cell: () => |
| 19 | + Array.from({ length: 3 }).map((_, coinIndex) => ( |
| 20 | + <Skeleton key={coinIndex} className='skeleton coin-skeleton' /> |
| 21 | + )), |
| 22 | + }, |
| 23 | + { |
| 24 | + header: '24h Change', |
| 25 | + cellClassName: 'change-header-cell', |
| 26 | + cell: () => ( |
| 27 | + <div className='change-cell'> |
39 | 28 | <Skeleton className='skeleton value-skeleton-sm' /> |
40 | | - </TableCell> |
41 | | - <TableCell className='value-cell'> |
42 | | - <Skeleton className='skeleton value-skeleton-md' /> |
43 | | - </TableCell> |
44 | | - <TableCell className='value-cell'> |
45 | | - <Skeleton className='skeleton value-skeleton-lg' /> |
46 | | - </TableCell> |
47 | | - </TableRow> |
48 | | - ))} |
49 | | - </TableBody> |
50 | | - </Table> |
| 29 | + <Skeleton className='skeleton change-icon' /> |
| 30 | + </div> |
| 31 | + ), |
| 32 | + }, |
| 33 | + { |
| 34 | + header: 'Market Cap', |
| 35 | + cellClassName: 'market-cap-cell', |
| 36 | + cell: () => <Skeleton className='skeleton value-skeleton-md' />, |
| 37 | + }, |
| 38 | + { |
| 39 | + header: '24h Volume', |
| 40 | + cellClassName: 'volume-cell', |
| 41 | + cell: () => <Skeleton className='skeleton value-skeleton-lg' />, |
| 42 | + }, |
| 43 | + ]} |
| 44 | + data={Array.from({ length: 6 })} |
| 45 | + rowKey={(_, index) => index} |
| 46 | + /> |
51 | 47 | </div> |
52 | 48 | ); |
53 | 49 |
|
54 | 50 | export const CoinOverviewFallback = () => ( |
55 | 51 | <div id='coin-overview-fallback'> |
56 | | - <div className='panel'> |
57 | | - <div className='header'> |
58 | | - <Skeleton className='skeleton header-image' /> |
59 | | - <div className='header-lines'> |
60 | | - <Skeleton className='skeleton header-line-sm' /> |
61 | | - <Skeleton className='skeleton header-line-lg' /> |
| 52 | + <div id='candlestick-chart' className='is-fallback'> |
| 53 | + <div className='chart-header'> |
| 54 | + <div className='flex-1'> |
| 55 | + <div className='header'> |
| 56 | + <Skeleton className='skeleton header-image' /> |
| 57 | + <div className='info'> |
| 58 | + <Skeleton className='skeleton header-line-sm' /> |
| 59 | + <Skeleton className='skeleton header-line-lg' /> |
| 60 | + </div> |
| 61 | + </div> |
62 | 62 | </div> |
| 63 | + <div className='button-group'> |
| 64 | + {Array.from({ length: 7 }).map((_, index) => ( |
| 65 | + <Skeleton |
| 66 | + key={index} |
| 67 | + className='skeleton period-button-skeleton' |
| 68 | + /> |
| 69 | + ))} |
| 70 | + </div> |
| 71 | + </div> |
| 72 | + <div className='chart'> |
| 73 | + <Skeleton className='skeleton chart-skeleton' /> |
63 | 74 | </div> |
64 | | - <Skeleton className='skeleton chart-skeleton' /> |
65 | 75 | </div> |
66 | 76 | </div> |
67 | 77 | ); |
68 | 78 |
|
69 | 79 | export const TrendingCoinsFallback = () => ( |
70 | 80 | <div id='trending-coins-fallback'> |
71 | 81 | <h4>Trending Coins</h4> |
72 | | - <div className='table-wrapper custom-scrollbar'> |
73 | | - <Table> |
74 | | - <TableHeader className='header'> |
75 | | - <TableRow className='header-row'> |
76 | | - <TableHead className='head head-left'>Name</TableHead> |
77 | | - <TableHead className='head'>24h Change</TableHead> |
78 | | - <TableHead className='head head-right'>Price</TableHead> |
79 | | - </TableRow> |
80 | | - </TableHeader> |
81 | | - <TableBody> |
82 | | - {Array.from({ length: 6 }).map((_, index) => ( |
83 | | - <TableRow key={index} className='row'> |
84 | | - <TableCell className='name-cell'> |
85 | | - <div className='name'> |
86 | | - <Skeleton className='skeleton name-image' /> |
87 | | - <Skeleton className='skeleton name-line' /> |
88 | | - </div> |
89 | | - </TableCell> |
90 | | - <TableCell className='change-cell'> |
91 | | - <Skeleton className='skeleton change-line' /> |
92 | | - </TableCell> |
93 | | - <TableCell className='price-cell'> |
94 | | - <Skeleton className='skeleton price-line' /> |
95 | | - </TableCell> |
96 | | - </TableRow> |
97 | | - ))} |
98 | | - </TableBody> |
99 | | - </Table> |
100 | | - </div> |
| 82 | + <DataTable |
| 83 | + tableClassName='trending-coins-table mt-3' |
| 84 | + headerCellClassName='py-3!' |
| 85 | + bodyCellClassName='py-2!' |
| 86 | + columns={[ |
| 87 | + { |
| 88 | + header: 'Name', |
| 89 | + cellClassName: 'name-cell', |
| 90 | + cell: () => ( |
| 91 | + <div className='name-link'> |
| 92 | + <Skeleton className='skeleton name-image' /> |
| 93 | + <Skeleton className='skeleton name-line' /> |
| 94 | + </div> |
| 95 | + ), |
| 96 | + }, |
| 97 | + { |
| 98 | + header: '24h Change', |
| 99 | + cellClassName: 'change-cell', |
| 100 | + cell: () => ( |
| 101 | + <div className='price-change'> |
| 102 | + <Skeleton className='skeleton change-line' /> |
| 103 | + <Skeleton className='skeleton change-icon' /> |
| 104 | + </div> |
| 105 | + ), |
| 106 | + }, |
| 107 | + { |
| 108 | + header: 'Price', |
| 109 | + cellClassName: 'price-cell', |
| 110 | + cell: () => <Skeleton className='skeleton price-line' />, |
| 111 | + }, |
| 112 | + ]} |
| 113 | + data={Array.from({ length: 6 })} |
| 114 | + rowKey={(_, index) => index} |
| 115 | + /> |
101 | 116 | </div> |
102 | 117 | ); |
0 commit comments