fix: sorting of projects chart
All checks were successful
Deploy Blog / deploy (push) Successful in 1m53s
All checks were successful
Deploy Blog / deploy (push) Successful in 1m53s
This commit is contained in:
parent
69d5afe641
commit
6821f93083
1 changed files with 91 additions and 86 deletions
|
|
@ -28,10 +28,11 @@ const CodeStats = () => {
|
||||||
"Error"
|
"Error"
|
||||||
)
|
)
|
||||||
|
|
||||||
const personalProjects =
|
const personalProjects = (
|
||||||
data && data?.projects.filter((project) => !project.key.includes("gp-"))
|
data && data?.projects.filter((project) => !project.key.includes("gp-"))
|
||||||
|
).sort((a, b) => b.total - a.total)
|
||||||
|
|
||||||
const mainProject = personalProjects?.sort((a, b) => a.total > b.total)[0].key
|
const mainProject = personalProjects[0].key
|
||||||
|
|
||||||
console.log(personalProjects)
|
console.log(personalProjects)
|
||||||
|
|
||||||
|
|
@ -95,7 +96,11 @@ const CodeStats = () => {
|
||||||
<ProjectsChart chartData={projectsChartData} error={error} />
|
<ProjectsChart chartData={projectsChartData} error={error} />
|
||||||
<div className="text-sm text-center text-muted-foreground">
|
<div className="text-sm text-center text-muted-foreground">
|
||||||
Data sourced from my self-hosted{" "}
|
Data sourced from my self-hosted{" "}
|
||||||
<a href="https://wakapi.dev/" target="__blank">
|
<a
|
||||||
|
href="https://wakapi.dev/"
|
||||||
|
target="__blank"
|
||||||
|
className="underline decoration-1 hover:text-primary/80 underline-offset-4 text-primary"
|
||||||
|
>
|
||||||
Wakapi
|
Wakapi
|
||||||
</a>{" "}
|
</a>{" "}
|
||||||
instance.
|
instance.
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue