1313 <button class =" icon" type =" button" title =" sort by forks" @click =" sort('forks')" >
1414 <icon-git-fork />
1515 </button >
16+ <button class =" icon" type =" button" title =" sort by issues" @click =" sort('issues')" >
17+ <icon-circle-dot />
18+ </button >
1619 <button class =" icon" type =" button" title =" sort by language" @click =" sort('language')" >
1720 <icon-packages />
1821 </button >
3336import { computed , ref , useTemplateRef } from " vue" ;
3437import { refDebounced } from " @vueuse/core" ;
3538import { useSortable } from " @vueuse/integrations/useSortable" ;
36- import { IconGitFork , IconPackages , IconSortAZ , IconStar } from " @tabler/icons-vue" ;
39+ import { IconCircleDot , IconGitFork , IconPackages , IconSortAZ , IconStar } from " @tabler/icons-vue" ;
3740import { useRepositoriesStore } from " @/store/repositories" ;
3841import { useSettingsStore } from " @/store/settings" ;
3942import RepoItem from " @/components/repo-item.vue" ;
@@ -54,12 +57,14 @@ const filteredItems = computed(() => {
5457const reposRef = useTemplateRef (" reposElement" );
5558useSortable (reposRef , repositories , { handle: " .repo__header-actions-handler" });
5659
57- function sort(option : " alphabetic" | " stars" | " forks" | " language" ): void {
60+ type SortOption = " alphabetic" | " stars" | " forks" | " issues" | " language" ;
61+ function sort(option : SortOption ): void {
5862 repositories .value .sort ((a , b ) => {
5963 switch (option ) {
6064 case " alphabetic" : return a .name .localeCompare (b .name );
6165 case " stars" : return b .stargazers_count - a .stargazers_count ;
6266 case " forks" : return b .forks_count - a .forks_count ;
67+ case " issues" : return b .open_issues_count - a .open_issues_count ;
6368 case " language" :
6469 return (a .language && b .language ) ?
6570 a .language .localeCompare (b .language ) :
0 commit comments