11/* eslint-disable @typescript-eslint/no-explicit-any */
22import { memo , useMemo } from 'react' ;
3- import {
4- CloneIcon ,
5- DeploymentsIcon ,
6- DownloadIcon ,
7- OpenIcon ,
8- ShareIcon ,
9- TropyIcon
10- } from '../../icons' ;
3+ import { Box } from '../../base' ;
4+ import { iconXSmall } from '../../constants/iconsSizes' ;
5+ import { LeaderBoardIcon , TropyIcon } from '../../icons' ;
116import { useTheme } from '../../theme' ;
127import { Carousel } from '../Carousel' ;
138import { Pattern } from '../CustomCatalog/CustomCard' ;
@@ -21,7 +16,6 @@ import {
2116 HeaderTitle ,
2217 IconContainer ,
2318 MainContainer ,
24- RepoSection ,
2519 RepoTitle ,
2620 StatsValue ,
2721 StatusLabel ,
@@ -32,7 +26,6 @@ import {
3226
3327interface MetricConfig {
3428 label : string ;
35- icon : React . ComponentType < any > ;
3629 id : string ;
3730 countKey : keyof Pattern ;
3831}
@@ -55,7 +48,6 @@ interface StatCardProps {
5548 pattern : Pattern ;
5649 userName : string ;
5750 userid : string ;
58- icon : React . ComponentType < any > ;
5951 status : string ;
6052 id : string ;
6153 onCardClick : ( pattern : Pattern ) => void ;
@@ -86,32 +78,27 @@ const BASE_QUERY_PARAMS: BaseQueryParams = {
8678const METRICS : Record < MetricType , MetricConfig > = {
8779 view : {
8880 label : 'Most Opens' ,
89- icon : OpenIcon ,
90- id : 'open-icon' ,
81+ id : 'open' ,
9182 countKey : 'view_count'
9283 } ,
9384 clone : {
9485 label : 'Most Clones' ,
95- icon : CloneIcon ,
96- id : 'clone-icon' ,
86+ id : 'clone' ,
9787 countKey : 'clone_count'
9888 } ,
9989 download : {
10090 label : 'Most Downloads' ,
101- icon : DownloadIcon ,
102- id : 'download-icon' ,
91+ id : 'download' ,
10392 countKey : 'download_count'
10493 } ,
10594 deployment : {
10695 label : 'Most Deploys' ,
107- icon : DeploymentsIcon ,
108- id : 'deployments-icon' ,
96+ id : 'deployments' ,
10997 countKey : 'deployment_count'
11098 } ,
11199 share : {
112100 label : 'Most Shares' ,
113- icon : ShareIcon ,
114- id : 'share-icon' ,
101+ id : 'share' ,
115102 countKey : 'share_count'
116103 }
117104} ;
@@ -129,7 +116,6 @@ const StatCardComponent: React.FC<StatCardProps> = ({
129116 pattern,
130117 userName,
131118 userid,
132- icon : Icon ,
133119 status,
134120 id,
135121 onCardClick,
@@ -162,16 +148,16 @@ const StatCardComponent: React.FC<StatCardProps> = ({
162148 < HeaderSection >
163149 < HeaderTitle > { label } </ HeaderTitle >
164150 < IconContainer onClick = { ( e ) => handleIconClick ( e , `${ countKey } +desc` ) } >
165- < Icon className = { id } />
151+ < LeaderBoardIcon { ... iconXSmall } />
166152 </ IconContainer >
167153 </ HeaderSection >
168154
169155 < StatsValue > { count } </ StatsValue >
170156
171- < RepoSection >
157+ < Box >
172158 < RepoTitle > { patternName } </ RepoTitle >
173159 < UserNameText onClick = { handleAuthorClick } > by { userName } </ UserNameText >
174- </ RepoSection >
160+ </ Box >
175161 </ ContentWrapper >
176162 < StatusLabel labelType = { status } onClick = { handleStatusClick } >
177163 { status }
@@ -247,7 +233,6 @@ const processQueryData = (
247233 pattern : pattern ,
248234 userName : pattern . user ?. first_name || 'Unknown' ,
249235 userid : pattern . user ?. id ,
250- icon : config . icon ,
251236 id : config . id ,
252237 status : pattern ?. catalog_data ?. content_class
253238 } ;
0 commit comments