1+ <template >
2+ <div class =" space-y-4 md:space-y-6" >
3+ <!-- Section Header -->
4+ <div class =" flex items-center gap-2 mb-4" >
5+ <div :class =" `w-2 h-2 ${type === 'input' ? 'bg-blue-400' : 'bg-green-400'} rounded-full animate-pulse`" ></div >
6+ <span :class =" `${type === 'input' ? 'text-blue-400' : 'text-green-400'} text-sm font-semibold uppercase tracking-wider`" >
7+ {{ title }}
8+ </span >
9+ </div >
10+
11+ <!-- Input Code Blocks -->
12+ <div v-if =" type === 'input'" class =" space-y-4" >
13+ <div v-for =" (block, index) in codeBlocks" :key =" index" >
14+ <div class =" text-gray-500 text-xs mb-2 font-mono" >{{ block.comment }}</div >
15+ <pre class =" text-emerald-400 font-mono text-xs md:text-sm leading-relaxed overflow-x-auto" ><code v-html =" block.code" ></code ></pre >
16+ </div >
17+ </div >
18+
19+ <!-- Output Blocks -->
20+ <div v-if =" type === 'output'" class =" space-y-4" >
21+ <div
22+ v-for =" (block, index) in outputBlocks"
23+ :key =" index"
24+ class =" bg-gray-800/50 rounded-lg p-3 md:p-4 border border-gray-700/30"
25+ >
26+ <div class =" flex items-center gap-2 mb-2" >
27+ <div :class =" `w-3 h-3 bg-${block.color}-500 rounded-full`" ></div >
28+ <span :class =" `text-${block.color}-400 text-xs font-bold`" >{{ block.title }}</span >
29+ </div >
30+ <div class =" space-y-1 text-xs font-mono text-gray-300 overflow-x-auto" >
31+ <div v-for =" (item, itemIndex) in block.items" :key =" itemIndex" >
32+ <span v-if =" item.method" :class =" `text-${item.color}-400`" >{{ item.method }}</span >
33+ <span v-if =" item.endpoint" >{{ item.endpoint }}</span >
34+ <span v-if =" item.text" >{{ item.text }}</span >
35+ </div >
36+ </div >
37+ </div >
38+ </div >
39+ </div >
40+ </template >
41+
42+ <script setup lang="ts">
43+ interface CodeBlock {
44+ comment: string
45+ code: string
46+ }
47+
48+ interface OutputItem {
49+ method? : string
50+ endpoint? : string
51+ color? : string
52+ text? : string
53+ }
54+
55+ interface OutputBlock {
56+ title: string
57+ color: string
58+ items: OutputItem []
59+ }
60+
61+ interface Props {
62+ type: ' input' | ' output'
63+ title: string
64+ codeBlocks? : CodeBlock []
65+ outputBlocks? : OutputBlock []
66+ }
67+
68+ defineProps <Props >()
69+ </script >
0 commit comments