@@ -18,19 +18,6 @@ import { joinURL } from 'ufo'
1818import { useCharts } from ' ~/composables/useCharts'
1919import { createSmoothPath } from ' vue-data-ui/utils'
2020
21- const REPO_PROVIDER_ICONS: Record <string , string > = {
22- github: ' i-simple-icons:github' ,
23- gitlab: ' i-simple-icons:gitlab' ,
24- bitbucket: ' i-simple-icons:bitbucket' ,
25- codeberg: ' i-simple-icons:codeberg' ,
26- gitea: ' i-simple-icons:gitea' ,
27- forgejo: ' i-simple-icons:forgejo' ,
28- gitee: ' i-simple-icons:gitee' ,
29- sourcehut: ' i-simple-icons:sourcehut' ,
30- tangled: ' i-custom:tangled' ,
31- radicle: ' i-lucide:network' ,
32- }
33-
3421function sortJsDelivrNodes(nodes : JsDelivrFileNode []) {
3522 return [... nodes ].sort ((a , b ) => {
3623 if (a .type !== b .type ) return a .type === ' directory' ? - 1 : 1
@@ -76,10 +63,7 @@ const repositoryUrl = computed(() => {
7663})
7764
7865const { repoRef, stars, refresh : refreshRepoMeta } = useRepoMeta (repositoryUrl )
79- const repoProviderIcon = computed (() => {
80- const provider = repoRef .value ?.provider
81- return provider ? (REPO_PROVIDER_ICONS [provider ] ?? ' i-lucide:code' ) : ' i-lucide:code'
82- })
66+ const repoProviderIcon = useProviderIcon (() => repoRef .value ?.provider , ' i-lucide:code' )
8367
8468const formattedStars = computed (() => (stars .value > 0 ? compactFormat .format (stars .value ) : ' ' ))
8569
0 commit comments