11<script setup lang="ts">
2+ import { computed } from ' vue'
23import { Badge } from ' @/components/ui/badge'
4+ import { CodeHighlight } from ' @/components/ui/code-highlight'
35import { Shield , Package , Globe } from ' lucide-vue-next'
46
57interface Props {
@@ -9,14 +11,28 @@ interface Props {
911 packages? : any | null
1012 // eslint-disable-next-line @typescript-eslint/no-explicit-any
1113 remotes? : any | null
14+ showHeading? : boolean
1215}
1316
14- defineProps <Props >()
17+ const props = withDefaults (defineProps <Props >(), {
18+ showHeading: true
19+ })
20+
21+ // Format JSON for display
22+ const formattedPackages = computed (() => {
23+ if (! props .packages ) return ' '
24+ return JSON .stringify (props .packages , null , 2 )
25+ })
26+
27+ const formattedRemotes = computed (() => {
28+ if (! props .remotes ) return ' '
29+ return JSON .stringify (props .remotes , null , 2 )
30+ })
1531 </script >
1632
1733<template >
1834 <div class =" space-y-3" >
19- <h3 class =" text-sm font-semibold" >Specifications</h3 >
35+ <h3 v-if = " showHeading " class =" text-sm font-semibold" >Specifications</h3 >
2036
2137 <div class =" space-y-3" >
2238 <!-- Requires OAuth -->
@@ -39,7 +55,7 @@ defineProps<Props>()
3955 Packages
4056 </dt >
4157 <dd class =" text-sm" >
42- <pre class = " bg-muted border rounded p-3 text-xs overflow-x-auto " >{{ JSON.stringify(packages, null, 2) }}</ pre >
58+ <CodeHighlight : code = " formattedPackages " language="json" / >
4359 </dd >
4460 </div >
4561
@@ -50,7 +66,7 @@ defineProps<Props>()
5066 Remotes
5167 </dt >
5268 <dd class =" text-sm" >
53- <pre class = " bg-muted border rounded p-3 text-xs overflow-x-auto " >{{ JSON.stringify(remotes, null, 2) }}</ pre >
69+ <CodeHighlight : code = " formattedRemotes " language="json" / >
5470 </dd >
5571 </div >
5672 </div >
0 commit comments