11'use client'
22
33import { useQuery } from '@apollo/client'
4- import {
5- faStar ,
6- faFolderOpen ,
7- faQuestionCircle ,
8- faHandshake ,
9- } from '@fortawesome/free-regular-svg-icons'
104import {
115 faPeopleGroup ,
126 faCodeFork ,
137 faDollar ,
148 faCodePullRequest ,
159 faChartArea ,
1610 faExclamationCircle ,
11+ faQuestionCircle ,
12+ faFolderOpen ,
13+ faHandshake ,
1714 faTag ,
1815 faRocket ,
16+ faStar ,
1917 faTags ,
2018} from '@fortawesome/free-solid-svg-icons'
19+ import millify from 'millify'
2120import { useParams } from 'next/navigation'
2221import { FC , useState , useEffect } from 'react'
2322import { handleAppError } from 'app/global-error'
@@ -28,7 +27,6 @@ import DashboardCard from 'components/DashboardCard'
2827import GeneralCompliantComponent from 'components/GeneralCompliantComponent'
2928import LoadingSpinner from 'components/LoadingSpinner'
3029import MetricsScoreCircle from 'components/MetricsScoreCircle'
31-
3230const ProjectHealthMetricsDetails : FC = ( ) => {
3331 const { projectKey } = useParams ( )
3432 const [ metrics , setMetrics ] = useState < HealthMetricsProps > ( )
@@ -73,51 +71,51 @@ const ProjectHealthMetricsDetails: FC = () => {
7371 />
7472 </ div >
7573 < div className = "grid grid-cols-1 gap-4 md:grid-cols-3" >
76- < DashboardCard title = "Stars" icon = { faStar } stats = { metrics . starsCount . toString ( ) } />
77- < DashboardCard title = "Forks" icon = { faCodeFork } stats = { metrics . forksCount . toString ( ) } />
74+ < DashboardCard title = "Stars" icon = { faStar } stats = { millify ( metrics . starsCount ) } />
75+ < DashboardCard title = "Forks" icon = { faCodeFork } stats = { millify ( metrics . forksCount ) } />
7876 < DashboardCard
7977 title = "Contributors"
8078 icon = { faPeopleGroup }
81- stats = { metrics . contributorsCount . toString ( ) }
79+ stats = { millify ( metrics . contributorsCount ) }
8280 />
8381 </ div >
8482 < div className = "grid grid-cols-1 gap-4 md:grid-cols-3 lg:grid-cols-4" >
8583 < DashboardCard
8684 title = "Open Issues"
8785 icon = { faExclamationCircle }
88- stats = { metrics . openIssuesCount . toString ( ) }
86+ stats = { millify ( metrics . openIssuesCount ) }
8987 />
9088 < DashboardCard
9189 title = "Total Issues"
9290 icon = { faFolderOpen }
93- stats = { metrics . totalIssuesCount . toString ( ) }
91+ stats = { millify ( metrics . totalIssuesCount ) }
9492 />
9593 < DashboardCard
9694 title = "Unassigned Issues"
9795 icon = { faTag }
98- stats = { metrics . unassignedIssuesCount . toString ( ) }
96+ stats = { millify ( metrics . unassignedIssuesCount ) }
9997 />
10098 < DashboardCard
10199 title = "Unanswered Issues"
102100 icon = { faQuestionCircle }
103- stats = { metrics . unansweredIssuesCount . toString ( ) }
101+ stats = { millify ( metrics . unansweredIssuesCount ) }
104102 />
105103 </ div >
106104 < div className = "grid grid-cols-1 gap-4 md:grid-cols-3" >
107105 < DashboardCard
108106 title = "Open Pull Requests"
109107 icon = { faCodePullRequest }
110- stats = { metrics . openPullRequestsCount . toString ( ) }
108+ stats = { millify ( metrics . openPullRequestsCount ) }
111109 />
112110 < DashboardCard
113111 title = "Recent Releases"
114112 icon = { faRocket }
115- stats = { metrics . recentReleasesCount . toString ( ) }
113+ stats = { millify ( metrics . recentReleasesCount ) }
116114 />
117115 < DashboardCard
118116 title = "Total Releases"
119117 icon = { faTags }
120- stats = { metrics . totalReleasesCount . toString ( ) }
118+ stats = { millify ( metrics . totalReleasesCount ) }
121119 />
122120 </ div >
123121 < BarChart
0 commit comments