File tree Expand file tree Collapse file tree 3 files changed +20
-3
lines changed
app/pages/package/[[org]] Expand file tree Collapse file tree 3 files changed +20
-3
lines changed Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ if (import.meta.server) {
5858}
5959
6060// Fetch README for specific version if requested, otherwise latest
61- const { data : readmeData } = useLazyFetch <ReadmeResponse >(
61+ const { data : readmeData, status : readmeStatus } = useLazyFetch <ReadmeResponse >(
6262 () => {
6363 const base = ` /api/registry/readme/${packageName .value } `
6464 const version = resolvedVersion .value
@@ -1047,7 +1047,20 @@ const showSkeleton = shallowRef(false)
10471047
10481048 <!-- eslint-disable vue/no-v-html -- HTML is sanitized server-side -->
10491049 <Readme v-if =" readmeData?.html" :html =" readmeData.html" />
1050- <p v-else class =" text-fg-muted italic" >
1050+ <p
1051+ v-else-if =" readmeStatus === 'pending'"
1052+ class =" flex items-center gap-2 text-fg-subtle italic"
1053+ >
1054+ <span class =" i-svg-spinners:ring-resize w-4 h-4" aria-hidden =" true" />
1055+ <span >{{ $t('common.loading') }}…</span >
1056+ </p >
1057+ <p v-else-if =" readmeStatus === 'error'" class =" text-fg-muted italic" >
1058+ {{ $t('package.readme.error_loading') }}
1059+ </p >
1060+ <p
1061+ v-else-if =" readmeStatus === 'success' && !readmeData?.html"
1062+ class =" text-fg-muted italic"
1063+ >
10511064 {{ $t('package.readme.no_readme') }}
10521065 <a
10531066 v-if =" repositoryUrl"
Original file line number Diff line number Diff line change 481481 "warning" : " Warning" ,
482482 "caution" : " Caution"
483483 },
484- "copy_as_markdown" : " Copy README as Markdown"
484+ "copy_as_markdown" : " Copy README as Markdown" ,
485+ "error_loading" : " Failed to load README details"
485486 },
486487 "provenance_section" : {
487488 "title" : " Provenance" ,
Original file line number Diff line number Diff line change 14491449 },
14501450 "copy_as_markdown" : {
14511451 "type" : " string"
1452+ },
1453+ "error_loading" : {
1454+ "type" : " string"
14521455 }
14531456 },
14541457 "additionalProperties" : false
You can’t perform that action at this time.
0 commit comments